Closed kwhitley closed 3 months ago
I think this one will be killed in favor of AutoRouter
. It makes sense to keep the core as minimalist as possible for use-cases that demand it, while allowing AutoRouter
to be the batteries-included version for tiny demos.
Killed in favor of #222
Description
This adds support for passthrough options (e.g.
port
in a Bun service), as well as the following specific options:after
: what you would pass to a.then()
chain on therouter.handle/router.fetch
.errors
: what you would pass to a catch block. if not defined, Router will still throw (uncaught).Adds appx. 45 bytes.
Considerations
The bulk of the bytes added is to support the explicit try/catch block (and rethrow). If we did not support errors in this, it would be closer to 460 bytes total (instead of 490).
Example Usage
Type of Change (select one and follow subtasks)