v1.6.5/api refactor

This commit is contained in:
2020-09-01 22:27:52 -04:00
parent 993889846f
commit 9240697f08
4 changed files with 65 additions and 39 deletions
+5
View File
@@ -5,6 +5,11 @@ const mLogger = new Logger('modules', 'authenticator');
module.exports = (req, res, next) => {
mLogger.start();
res.set('Access-Control-Allow-Origin', ['*']);
if (req.url === '/') {
mLogger.success('HEARTBEAT', { URL: req.url });
res.status(200).send({ message: 'ALIVE' });
return next();
}
if (req.method === 'OPTIONS') {
mLogger.success('OPTIONS CALL', { URL: req.url });
res.status(200).send();