Created
July 29, 2019 23:49
-
-
Save blanks88/f773676e26ca04c7474d7de1ed982220 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const path = require('path'); | |
const app = express(); | |
// Run the app by serving the static files | |
// in the dist directory | |
app.use(express.static(__dirname + '/dist')); | |
// Start the app by listening on the default | |
// Heroku port | |
app.listen(process.env.PORT || 8080); | |
// For all GET requests, send back index.html | |
// so that PathLocationStrategy can be used | |
app.get('/*', function(req, res) { | |
res.sendFile(path.join(__dirname + '/dist/index.html')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment