UNPKG
@node-scarlet/http
Version:
latest (0.10.4)
0.10.4
0.10.3
0.10.2
0.10.1
0.10.0
0.9.0
0.8.1
0.8.0
0.7.1
0.7.0
0.6.0
0.5.0
0.4.0
0.3.1
0.3.0
0.2.0
0.1.0
0.0.0
Build APIs Instantly 🏋️♂️
github.com/node-scarlet/http
node-scarlet/http
@node-scarlet/http
/
src
/
experimental
/
protect.ts
7 lines
(6 loc)
•
150 B
text/typescript
View Raw
1
2
3
4
5
6
7
/** * Wrapper handlers with error catching */
export
const
protect =
async
(fn) => {
return
async
(req, meta) => fn(req, meta).
catch
(e =>
404
); }