Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
moahmedwafy
/
modarb-be
like
0
Sleeping
App
Files
Files
Community
Fetching metadata from the HF Docker repository...
cbd4fc9
modarb-be
/
src
/
helpers
/
async-handler.ts
moahmedwafy
feat: add async handler
f39e411
about 1 year ago
raw
Copy download link
history
blame
Safe
170 Bytes
export
function
asyncHandler
(
fn
) {
return
async
function
(
req, res, next
) {
try
{
await
fn
(req, res, next);
}
catch
(err) {
next
(err);
}
};
}