Static GitHub Issues

[1486] servermiddleware routes are not recognized

prev: Allow assets to be exported with a prefix
next: I can't use fs package in pages
module.exports = {
  serverMiddleware: [
      { path: '/api', handler: '~/api/index.js' }
  ]

does not actually pick up requests to /api/* and does not generate a route in .nuxt/router.js.

module.exports = {
  serverMiddleware: [
      '~/api/index.js'
  ]

does pick everything up though, however this leaves you to check the url in the middleware and applies to every request which is not efficient - or neat.

"version": "1.0.0-rc6",

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1325">#c1325</a>)</em></sub></div>