Skip to content

Instantly share code, notes, and snippets.

@Tonel
Created October 17, 2022 16:02
Show Gist options
  • Save Tonel/900182f7a85de60b1d7f73c37f932c76 to your computer and use it in GitHub Desktop.
Save Tonel/900182f7a85de60b1d7f73c37f932c76 to your computer and use it in GitHub Desktop.
const express = require("express");
const path = require("path");
const app = express()
const PORT = process.env.PORT || 3000
app.use(express.static(path.join(__dirname, "build")))
app.get("*", function (req, res) {
res.sendFile(path.join(__dirname, "build", "index.html"))
})
app.listen(PORT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment