adding scripts for heroku to properly run express app to serve files

This commit is contained in:
Arjun Patel
2019-06-09 23:13:10 -07:00
parent a63268793a
commit 280f2cb6be
6 changed files with 329 additions and 150 deletions
+16
View File
@@ -0,0 +1,16 @@
var express = require('express');
var app = express();
var path = require('path');
const PORT = process.env.PORT || 8080;
app.use(express.static('dist'));
// viewed at http://localhost:8080
app.get('*', function(req, res) {
res.sendFile('index.html');
});
console.log('Starting server on port: ' + PORT);
app.listen(PORT);