Skip to content
This repository was archived by the owner on Sep 13, 2023. It is now read-only.

v2.0.0

Choose a tag to compare

@eheikes eheikes released this 18 May 20:11
· 32 commits to master since this release

New Features

  • A custom Content-Type header can now be set in the responses.
  • Added some logging (toggled with logger.enable() and logger.disable()).
  • Added collectionKey, countKey, limitParam, offsetParam, and queryParam options.
  • Added support for overriding the MiddlewareRule handlers entirely (using the handler callback).
  • Added query parameters for sorting collection results.
  • Requests can now use a form body (application/x-www-form-urlencoded).
  • Added support for PUT /example.
  • Added support for DELETE /example.

Breaking Changes

  • The original query parameters are now passed to the postfilter callbacks, rather than the prefilter-ed parameters.
  • Middleware.prototype.addResource() now returns the new rule, rather than the middleware instance.
  • Default (fallthrough) middleware now logs a message and continues to the next middleware, rather than returning a 404 response.
  • The prefilter and postfilter callbacks can't be passed in a constructor option anymore; they can be changed after the rule is created.

Bug Fixes

  • Added missing prefilter call to MiddlewareRule.prototype.replaceItem().