Skip to content

Instantly share code, notes, and snippets.

@mauricedb
Created November 26, 2017 10:07
Show Gist options
  • Save mauricedb/bb0290b26322909686183c64a31ad3b7 to your computer and use it in GitHub Desktop.
Save mauricedb/bb0290b26322909686183c64a31ad3b7 to your computer and use it in GitHub Desktop.
const path = require("path");
const express = require("express");
const serveStatic = require("serve-static");
const reactApp = require("./react-app");
const PORT = process.env.PORT || 3001;
const app = express();
app.use(reactApp);
app.use(serveStatic(path.join(__dirname, "../build")));
app.listen(PORT, () => {
console.log(`Server listening on port ${PORT}!`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment