diff --git a/server.js b/server.js new file mode 100644 index 0000000..c871457 --- /dev/null +++ b/server.js @@ -0,0 +1,17 @@ +import express from "express"; +import path from "path"; + +const app = express(); +const PORT = process.env.PORT || 3000; + +// Serve static files from dist +app.use(express.static(path.join(__dirname, "dist"))); + +// For React Router: always return index.html +app.get("*", (req, res) => { + res.sendFile(path.join(__dirname, "dist", "index.html")); +}); + +app.listen(PORT, () => { + console.log(`Server running at http://localhost:${PORT}`); +});