adding scripts for heroku to properly run express app to serve files
This commit is contained in:
@@ -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);
|
||||
Reference in New Issue
Block a user