Last active
March 26, 2019 14:54
-
-
Save ajerez/a365f89e1daac364462ae7aea0e10268 to your computer and use it in GitHub Desktop.
server.js for Heroku deployment of a Vue Project with Node and Express.js
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
let history = require("connect-history-api-fallback"); | |
let express = require("express"); | |
let path = require("path"); | |
let serveStatic = require("serve-static"); | |
let compression = require("compression"); | |
let app = express(); | |
app.use(compression()); | |
app.use(history()); | |
app.use(serveStatic(__dirname + "/dist")); | |
let port = process.env.PORT || 5000; | |
app.listen(port); | |
console.log("Server started. Port: " + port); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment