async/await

This commit is contained in:
Flummi
2019-04-26 09:23:16 +00:00
parent 6f6f3c8481
commit 06f665b220
4 changed files with 82 additions and 66 deletions

View File

@@ -16,5 +16,5 @@ http.createServer((req, res, r) => {
console.log(`[${(new Date()).toLocaleTimeString()}] ${req.method} ${req.url.pathname}`);
!(r = routes.getRegex(req.url.pathname, req.method)) ? res.end(`404 - ${req.url.pathname}`) : r(req, res);
!(r = routes.getRegex(req.url.pathname, req.method)) ? res.writeHead(404).end(`404 - ${req.url.pathname}`) : r(req, res);
}).listen(cfg.websrv.port, () => console.log(`f0ck is listening on port ${cfg.websrv.port}.`));