mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-19 19:49:37 +02:00
Split apps controllers into separate files
This commit is contained in:
parent
b7de1e3d27
commit
34279c8b8c
16 changed files with 444 additions and 398 deletions
|
@ -1,17 +1,7 @@
|
|||
// const asyncWrapper = foo => (req, res, next) => {
|
||||
// return Promise
|
||||
// .resolve(foo(req, res, next))
|
||||
// .catch(next);
|
||||
// }
|
||||
|
||||
// module.exports = asyncWrapper;
|
||||
|
||||
function asyncWrapper(foo) {
|
||||
return function (req, res, next) {
|
||||
return Promise
|
||||
.resolve(foo(req, res, next))
|
||||
.catch(next);
|
||||
}
|
||||
return Promise.resolve(foo(req, res, next)).catch(next);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = asyncWrapper;
|
||||
module.exports = asyncWrapper;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue