You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add shortcut for using a custom catch-all handler (#17)
* Add mechanism for using a custom catch-all handler
Implemented as an option to server instantiation.
* use existing utility to set http status code
* update mechanism of adding the catchAll handler via server options
It now internally uses the router catch-all
* Simplify route matching logic
* Update to std@v0.56.0
* Simplify request configuration
* Simplify syntax in code example
Co-authored-by: Seth Holladay <me@seth-holladay.com>
Copy file name to clipboardExpand all lines: README.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -198,6 +198,20 @@ const server = pogo.server();
198
198
199
199
Type: `object`
200
200
201
+
##### catchAll
202
+
203
+
Type: `function`
204
+
205
+
Optional route handler to be used as a fallback for requests that do not match any other route. This overrides the default 404 Not Found behavior built into the framework. Shortcut for `server.router.all('/{catchAll*}', catchAll)`.
0 commit comments