Features
-
Add
onError
andonNoMatch
options: e431583 -
Mount middleware groups & sub-applications to specific base pathnames (#8): e3c6966
-
Execute sub-applications' included middleware: e3c6966, b23d29f
We pass off the entire request to the sub-app directly, rather than stealing & reconstructing its routes in the main Polka instance.
-
Offer
@polka/send
and@polka/send-type
response helpers (#5): 815aaef, 2dac7a0
Breaking
-
Remove
app.send
prototype: 11052b7Use
@polka/send
or@polka/send-type
instead. -
Remove
app.start
prototype: a24fae2Use
app.listen
instead. -
Require a
base
path to mount sub-applications: e3c6966- Mutates the
req.url
once abase
app or middleware group has been found
_ Includes areq.originalUrl
value once abase
has been matched
- Mutates the
Patches
-
Allow asynchronous or dynamically-routed middleware to terminate the response: e3c6966
A middleware like
serve-static
can't know ahead of time if it will find a file. Now theapp.handler
gives it a chance to, rather than exiting immediately. -
Respond with
404
instead of405
if no route definition.
Examples
- Added
examples/with-body-parser
: 00d997f - Added
examples/with-https
: 2ecb748 - Added
examples/with-serve-static
: 7a04093, cacc5be - Added
examples/with-uws
: 9965f8a - Updated
async-json
&sub-app
demos: b338d75, 90c1fd2