UNPKG
get-express-starter
Version:
latest (3.2.2)
3.2.2
3.2.0
3.1.0
3.0.0
2.1.2
2.1.1
2.0.1
1.1.1
1.1.0
1.0.0
0.1.0
Get production ready express boilerplate with a single command
get-express-starter
/
templates
/
node-express-boilerplate
/
src
/
utils
/
catch-async.js
6 lines
(4 loc)
•
147 B
JavaScript
View Raw
1
2
3
4
5
6
const
catchAsync
= (
fn
) =>
(
req, res, next
) =>
{
Promise
.
resolve
(
fn
(req, res, next)).
catch
(
(
err
) =>
next
(err)); };
module
.
exports
= catchAsync;