Archived
Private
Public Access
1
0
This repository has been archived on 2026-02-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2023-05-01 18:40:19 +02:00

12 lines
364 B
JavaScript

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));