Skip to content
This repository was archived by the owner on Nov 22, 2025. It is now read-only.

Release v0.3.6 - 2017-11-07

Choose a tag to compare

@shirohana shirohana released this 08 Nov 18:53
· 83 commits to dev since this release
v0.3.6

Added

  • New option: ignorePaths

    If the incoming request path is contains in ignorePaths, dynapi will pass the request to the
    next middleware directly.

    It's useful when you serving API with resources. Here is an example: Using with Nuxt.js and
    express-session

  • Now you can send headers in middlewares as expected. (Like using redirect)

Changed

  • Now errors thrown by route files are silent in default when options.dev === false (or says
    process.env.NODE_ENV === 'production')

    You can still forcing silent or not by providing it in Error object, for example:

    // >check-post-data.js
    export default (req, res, next) => {
      if (typeof req.body.username === 'string') {
        return next()
      } else {
        return next({ silent: true, status: 400 }) // Always silent even in dev-mode
      }
    }

Fixed

  • Fix middlewares do not used when request path not exists in routesDir since loose-mode added