Add more control

This commit is contained in:
2026-06-29 09:41:02 +02:00
parent 2e62d2d810
commit 8207e84fa2
11 changed files with 890 additions and 56 deletions
+25
View File
@@ -0,0 +1,25 @@
import express from "express";
import path from "path";
import { fileURLToPath } from "url";
const app = express();
const port = process.env.PORT || 3000;
function createServer() {
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const distPath = path.join(__dirname, "dist");
app.use(express.static(distPath));
app.get("*a", function (_, res) {
res.sendFile(path.join(distPath, "index.html"));
});
app.listen(port, function () {
console.log("server running on " + port);
});
}
createServer();