Archived
Private
Public Access
1
0

switched to express

This commit is contained in:
2023-05-01 18:40:19 +02:00
parent 9b68b3feec
commit 3678e1008b
9 changed files with 1971 additions and 2958 deletions

View File

@@ -0,0 +1,11 @@
const fileExists = require('fs').existsSync;
const express = require('express');
const app = express();
const port = process.env.PORT || 80;
app.get('**', (req, res) => {
let file = req.url;
if (!fileExists("./www/" + file)) file = "index.html";
res.sendFile(file, { root: "www" });
});
app.listen(port, () => console.log("Server started on: " + port));