switched to express
This commit is contained in:
11
BetterIServ.Mobile/server/server.js
Normal file
11
BetterIServ.Mobile/server/server.js
Normal 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));
|
||||
Reference in New Issue
Block a user