You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Say new-routes.js has a route with fastify.patch('/entity', ...
That is available at http://.../hooked-plugin/children/entity , as by default dirNameRoutePrefix is set. So far so good.
In new-routes.js, I've set
export const autoPrefix = '/batch'
I would have expected the route to be now at http://.../hooked-plugin/children/batch/entity but instead is at http://.../hooked-plugin/batch/entity
If this is intended behavior, would you please mention in README for autoPrefix that it overwrites, not appends, to folder structure path?
This isn't consistent with When setting both options.prefix and plugin.autoPrefix they will be concatenated., but at least it's documented.
Thanks!
The text was updated successfully, but these errors were encountered:
Chiming in because I'm interested in 'fixing' this, but it seems like a considerable breaking change. The document is correct: when set, the prefix option passed to fastify.register() and the autoPrefix set in a plugin will be concatted. OP is asking that you also concat the prefix sourced from the directory name, which is currently overridden whenever autoPrefix is set: https://github.com/fastify/fastify-autoload/blob/master/index.js#L248.
Prerequisites
Issue
Hi,
Using the example from README
Say
new-routes.js
has a route withfastify.patch('/entity', ...
That is available at
http://.../hooked-plugin/children/entity
, as by defaultdirNameRoutePrefix
is set. So far so good.In
new-routes.js
, I've setI would have expected the route to be now at
http://.../hooked-plugin/children/batch/entity
but instead is athttp://.../hooked-plugin/batch/entity
If this is intended behavior, would you please mention in README for
autoPrefix
that it overwrites, not appends, to folder structure path?This isn't consistent with
When setting both options.prefix and plugin.autoPrefix they will be concatenated.
, but at least it's documented.Thanks!
The text was updated successfully, but these errors were encountered: