Created
January 5, 2016 19:27
-
-
Save ammark47/6a70f3184d06e7ffc304 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'); | |
var express = require('express'); | |
var helmet = require('helmet'); | |
var app = express(); | |
app.use(helmet()); | |
var staticPath = path.resolve(__dirname + '/build'); | |
app.use(express.static(staticPath)); | |
var server_port = process.env.PORT || CONFIG.port; | |
app.listen(server_port, function () { | |
console.log( "Listening on server_port " + server_port ); | |
console.log(__dirname); | |
}); | |
app.get("/", (req, res) => { | |
res.sendFile(__dirname + "/build/index.html"); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment