Node server configured

This commit is contained in:
Dmytro Barylo
2017-10-03 00:09:36 +03:00
parent c5cf0bd61a
commit 22f69c2e6a
5 changed files with 69 additions and 94 deletions

23
server.js Normal file
View File

@@ -0,0 +1,23 @@
var express = require('express');
var path = require('path');
var history = require('connect-history-api-fallback');
app = express();
app.use('/dist', express.static(path.join(__dirname + "/dist")));
app.use('/favicons', express.static(path.join(__dirname + "/favicons")));
app.use(history({
index: '/'
}));
var port = process.env.PORT || 5000;
app.get('/', function(req, res) {
res.sendFile(path.join(__dirname + '/index.html'));
});
app.listen(port);
console.log('server started '+ port);