Last active
September 17, 2018 02:52
-
-
Save gate5th/fa60b4c054fa5244f93d7437e994a19d to your computer and use it in GitHub Desktop.
oldschoolshuffle
This file contains hidden or 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
//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