mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-21 20:39:36 +02:00
SQLite database. App model and controller
This commit is contained in:
parent
8392c2422a
commit
2acc3b72ec
11 changed files with 1185 additions and 32 deletions
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;
|
Loading…
Add table
Add a link
Reference in a new issue