diff --git a/website/docs/routers/http-router.md b/website/docs/routers/http-router.md index 1ea2ff518..0cf8bc628 100644 --- a/website/docs/routers/http-router.md +++ b/website/docs/routers/http-router.md @@ -18,6 +18,7 @@ npm install --save @middy/http-router - `method` (string) (required): One of `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `OPTIONS` and `ANY` that will match to any method passed in - `path` (string) (required): AWS formatted path starting with `/`. Variable: `/{id}/`, Wildcard: `/{proxy+}` - `handler` (function) (required): Any `handler(event, context)` function +- `notFoundHandler` (function): Override default 404 error thrown with your own custom response. Passes in `{method, path}` NOTES: diff --git a/website/docs/routers/ws-router.md b/website/docs/routers/ws-router.md index 987689cc9..ccd37f985 100644 --- a/website/docs/routers/ws-router.md +++ b/website/docs/routers/ws-router.md @@ -17,6 +17,7 @@ npm install --save @middy/ws-router - `routes` (array[\{routeKey, handler\}]) (required): Array of route objects. - `routeKey` (string) (required): AWS formatted route key. ie `$connect`, `$disconnect`, `$default` - `handler` (function) (required): Any `handler(event, context, {signal})` function +- `notFoundHandler` (function): Override default 404 error thrown with your own custom response. Passes in `{routeKey}` NOTES: