Skip to content

Instantly share code, notes, and snippets.

@gate5th
Last active September 17, 2018 02:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gate5th/fa60b4c054fa5244f93d7437e994a19d to your computer and use it in GitHub Desktop.
Save gate5th/fa60b4c054fa5244f93d7437e994a19d to your computer and use it in GitHub Desktop.
oldschoolshuffle
//app.js in your ROOT directory
const express = require("express");
const path = require("path");
const app = express();
// Serve static files from the React app
app.use(express.static(path.join(__dirname, "build")));
// The "catchall" handler: for any request that doesn't
// match one above, send back React's index.html file.
app.get("*", (req, res) => {
res.sendFile(path.join(__dirname, "build", "index.html"));
});
const port = process.env.PORT || 3000;
app.listen(port);
console.log(`Old School Shuffle running in production on port ${port}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment