diff options
| author | Ritesh Ghosh <[email protected]> | 2023-08-07 14:50:37 +0530 |
|---|---|---|
| committer | Ritesh Ghosh <[email protected]> | 2023-08-07 14:50:37 +0530 |
| commit | 96348cd9999a6fbf0bef82d79fdd8a389f5a6c23 (patch) | |
| tree | 6fd21525082f1473fe53be94e222e7588d0b0dce | |
| parent | c543ab83fbbe2c45a9065f75a80dd347aec79292 (diff) | |
| download | aniwatch-api-96348cd9999a6fbf0bef82d79fdd8a389f5a6c23.tar.xz aniwatch-api-96348cd9999a6fbf0bef82d79fdd8a389f5a6c23.zip | |
refactor: added `notFoundHandler`
| -rw-r--r-- | src/config/notFoundHandler.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/config/notFoundHandler.ts b/src/config/notFoundHandler.ts new file mode 100644 index 0000000..8fb11d6 --- /dev/null +++ b/src/config/notFoundHandler.ts @@ -0,0 +1,8 @@ +import { RequestHandler } from "express"; +import createHttpError from "http-errors"; + +const notFoundHandler: RequestHandler = (req, res, next) => { + return next(createHttpError.NotFound()); +}; + +export default notFoundHandler; |
