idk
This commit is contained in:
@@ -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}`);
|
||||
});
|
||||
Reference in New Issue
Block a user