Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This a followup PR on #809 to improve router interface.
The internal code had been rewritten to leverage a much cleaner class pattern and rou3 was upgraded to v0.2.x with a new
(method, path)
signature.Router public changes (#787):
router.use(path, handler)
is deprecated. Userouter.all(path, handler)
instead.router.add(path, method: Method | Method[]
signature is changed to `router.add(method: Method, path)app.resolve
andhandler.__resolve
signature changes from(path)
to(method, path)
.params
as well (wanted feature for websocket users)Type changes:
RouteNode
type is changed toRouterEntry
router.add
allows lowercase methods, we prefer upper-case (consistent with webRequest
normalization) in internal types (HTTPMethod
)CreateRouterOptions
type is renamed toRouterOptions