Created
May 28, 2018 20:45
-
-
Save bishesh16/86b7eb57fffb7e7c379ad79bbddaa4fa 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
var path = require("path"), | |
express = require("express"); | |
var DIST_DIR = path.join(__dirname, "dist"), | |
PORT = 3000, | |
app = express(); | |
//Serving the files on the dist folder | |
app.use(express.static(DIST_DIR)); | |
//Send index.html when the user access the web | |
app.get("*", function (req, res) { | |
res.sendFile(path.join(DIST_DIR, "index.html")); | |
}); | |
app.listen(PORT); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment