Source and server for serving built files.

This commit is contained in:
2019-01-07 23:15:36 +01:00
parent 6967541ba1
commit 7d0293a818
7 changed files with 148 additions and 0 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');
var compression = require('compression')
app = express();
app.use(compression());
app.use('/static', express.static(path.join(__dirname + "/dist/static")));
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 + '/dist/index.html'));
});
console.log('Serving webpage on port:', port)
app.listen(port);