Implemented ESlint and passed down the rules

This commit is contained in:
Alexis
2021-01-20 19:07:56 +01:00
parent 615cced6ed
commit b318a88023
37 changed files with 2119 additions and 568 deletions

View File

@@ -1,4 +1,3 @@
'use strict'
// Router
const express = require('express');
let router = express.Router();
@@ -12,18 +11,18 @@ const Users = new UserRepository();
const generateAPIToken = (mail, password) => {
return Users.genAPIToken(mail, password)
.catch(err => {
throw err
})
}
throw err;
});
};
router.get('/genToken', async (req, res) => {
generateAPIToken(req.body.mail, req.body.password)
.then(v => {
res.setHeader('Content-Type', 'application/json;charset=utf-8')
res.end(JSON.stringify(v))
res.setHeader('Content-Type', 'application/json;charset=utf-8');
res.end(JSON.stringify(v));
})
.catch(err => {
res.status(err.code).send(JSON.stringify(err))
})
})
res.status(err.code).send(JSON.stringify(err));
});
});
module.exports = router;