Uh oh!
There was an error while loading. Please reload this page.
Conversation
✅ Deploy Preview for nuxt3-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
| * { path: '/server-middleware/**', handler: '~/server-middleware/index.ts' }, | ||
| * // We can create custom instances too, but only in development mode, they are ignored for the production bundle. | ||
| * { path: '/static2', handler: serveStatic(fileURLToPath(new URL('./static2', import.meta.url))) } | ||
| * { path: '/static2/**', handler: serveStatic(fileURLToPath(new URL('./static2', import.meta.url))) } |
There was a problem hiding this comment.
I would rather not to advocate routing features alongside with legacy server middleware
There was a problem hiding this comment.
then let's remove this entirely, as it won't work without the change.
There was a problem hiding this comment.
Okay right it seems a bug that we are broke with new handlers for legacy middleware.
There was a problem hiding this comment.
tracked in: https://github.com/nuxt/framework/issues/4235
Uh oh!
There was an error while loading. Please reload this page.
| * @example | ||
| * ```js | ||
| * export default function (req, res, next) { | ||
| * export default eventHandler(event => { |
There was a problem hiding this comment.
server-middleware option is basically a legacy option I would mark as deprecated soon. We don't need to update it's example with something it is not mean to be. (BTW for consistency we use defineEventHandler across Nuxt docs)
There was a problem hiding this comment.
Hm. I don't like leaving a legacy example. Shall we just remove and link to https://v3.nuxtjs.org/guide/features/server-routes#server-middleware instead?
There was a problem hiding this comment.
Me either but this IS a legacy option with expected (req, res) syntax :D Let's introduce new options and deprecate this.
serverMiddleware jsdocsCo-authored-by: pooya parsa <pyapar@gmail.com>
🔗 Linked issue
resolvesnuxt/nuxt#13813
❓ Type of change
📚 Description
This removes some of the old data from
serverMiddlewaredocs. I feel this could be considerably improved, maybe incorporating some of the nice new API docs... Or adding a notice suggesting using auto-detected~/server/apietc...?cc: @clemcode
📝 Checklist