async / await on controllers
duard opened this issue · comments
Carlos Eduardo commented
Why you dont use async / await on controllers ?
/**
* GET /api/users
*/
router.get('/', (req, res, next) => {
try {
resources = userService.getAllUsers();
return resources;
} catche(error) {
res.json(error);
});
Saugat Acharya commented
Because promises are fine. Async await is just a wrapper around Generators
and Promises
. You are free to do what you want.