github lukeed/polka v0.3.0

latest releases: v1.0.0-next.28, v1.0.0-next.27, v1.0.0-next.26...
6 years ago

Features

  • Add onError and onNoMatch 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: 11052b7

    Use @polka/send or @polka/send-type instead.

  • Remove app.start prototype: a24fae2

    Use app.listen instead.

  • Require a base path to mount sub-applications: e3c6966

    • Mutates the req.url once a base app or middleware group has been found
      _ Includes a req.originalUrl value once a base has been matched

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 the app.handler gives it a chance to, rather than exiting immediately.

  • Respond with 404 instead of 405 if no route definition.

Examples

Misc

Don't miss a new polka release

NewReleases is sending notifications on new releases.