Skip to content

Instantly share code, notes, and snippets.

@ammark47
Created January 5, 2016 19:27
Show Gist options
  • Save ammark47/6a70f3184d06e7ffc304 to your computer and use it in GitHub Desktop.
Save ammark47/6a70f3184d06e7ffc304 to your computer and use it in GitHub Desktop.
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