Make handling the api more sensible

This commit is contained in:
tgpethan 2020-05-21 13:15:39 +01:00
parent 8b063ea75f
commit 690fdad2fc

6
EUS.js
View file

@ -86,7 +86,8 @@ module.exports = {
res.set("X-Content-Type-Options", "nosniff"); res.set("X-Content-Type-Options", "nosniff");
// Check if returned value is true. // Check if returned value is true.
if (!req.url.includes("/api/")) { if (req.url.includes("/api/")) return handleAPI(req, res);
// Register the time at the start of the request // Register the time at the start of the request
d = new Date(); d = new Date();
startTime = d.getTime(); startTime = d.getTime();
@ -120,9 +121,6 @@ module.exports = {
global.modules.consoleHelper.printInfo(emoji.heavy_check, `${req.method}: ${chalk.green("[200]")} ${req.url} ${endTime - startTime}ms`); global.modules.consoleHelper.printInfo(emoji.heavy_check, `${req.method}: ${chalk.green("[200]")} ${req.url} ${endTime - startTime}ms`);
} }
}); });
} else {
return handleAPI(req, res);
}
}, },
post:function(req, res) { post:function(req, res) {
/* /*