mirror of
https://github.com/pawelmalak/flame.git
synced 2026-03-11 06:53:12 +08:00
SQLite database. App model and controller
This commit is contained in:
17
middleware/asyncWrapper.js
Normal file
17
middleware/asyncWrapper.js
Normal file
@@ -0,0 +1,17 @@
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = asyncWrapper;
|
||||
Reference in New Issue
Block a user