mirror of
https://github.com/Raghu-Ch/InventoryApp.git
synced 2026-02-10 12:53:03 -05:00
modified server file
This commit is contained in:
32
server.js
32
server.js
@@ -1,16 +1,34 @@
|
|||||||
//Install express server
|
//Install express server
|
||||||
|
// const express = require('express');
|
||||||
|
// const path = require('path');
|
||||||
|
|
||||||
|
// const app = express();
|
||||||
|
|
||||||
|
// // Serve only the static files form the dist directory
|
||||||
|
// app.use(express.static(__dirname + '/dist/ZID'));
|
||||||
|
|
||||||
|
// app.get('/*', function (req, res) {
|
||||||
|
|
||||||
|
// res.sendFile(path.join(__dirname + '/dist/ZID/index.html'));
|
||||||
|
// });
|
||||||
|
|
||||||
|
// // Start the app by listening on the default Heroku port
|
||||||
|
// app.listen(process.env.PORT || 8080);
|
||||||
|
|
||||||
const express = require('express');
|
const express = require('express');
|
||||||
|
const http = require('http');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
// Serve only the static files form the dist directory
|
app.use(express.static(path.join(__dirname, 'dist')));
|
||||||
app.use(express.static(__dirname + '/dist/ZID'));
|
|
||||||
|
|
||||||
app.get('/*', function (req, res) {
|
app.get('/*', (req, res) => {
|
||||||
|
res.sendFile(path.join(__dirname, 'dist/ZID/index.html'));
|
||||||
res.sendFile(path.join(__dirname + '/dist/ZID/index.html'));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Start the app by listening on the default Heroku port
|
const port = process.env.PORT || '6797';
|
||||||
app.listen(process.env.PORT || 8080);
|
app.set('port', port);
|
||||||
|
|
||||||
|
const server = http.createServer(app);
|
||||||
|
server.listen(port, () => console.log('Running'));
|
||||||
Reference in New Issue
Block a user