Implemented ESlint and passed down the rules
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user