|
|
@ -5,8 +5,7 @@ const fs = require('fs'),
|
|
|
|
|
|
|
|
|
|
|
|
console.log("Starting static server on port "+config.STATIC_PORT);
|
|
|
|
console.log("Starting static server on port "+config.STATIC_PORT);
|
|
|
|
|
|
|
|
|
|
|
|
(async () => {
|
|
|
|
http.createServer((req, res) => {
|
|
|
|
await http.createServer((req, res) => {
|
|
|
|
|
|
|
|
let url = req.url;
|
|
|
|
let url = req.url;
|
|
|
|
if(!req.url || req.url == "" || req.url == "/") url = "/index.html";
|
|
|
|
if(!req.url || req.url == "" || req.url == "/") url = "/index.html";
|
|
|
|
fs.readFile(config.STATIC_LOCATION + url, (err, data) => {
|
|
|
|
fs.readFile(config.STATIC_LOCATION + url, (err, data) => {
|
|
|
@ -22,4 +21,3 @@ console.log("Starting static server on port "+config.STATIC_PORT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}).listen(config.STATIC_PORT);
|
|
|
|
}).listen(config.STATIC_PORT);
|
|
|
|
})();
|
|
|
|
|
|
|
|