Skip to content

Instantly share code, notes, and snippets.

@gate5th gate5th/app.js
Last active Sep 17, 2018

What would you like to do?
//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;
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
You can’t perform that action at this time.