Open
Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the feature has not already been requested
🚀 Feature Proposal
The proposal is to have a way to select what route to create between the standard one and the one with the wildcard.
This is the current implementation (both routes are created):
fastify.route({
url: '/',
method: opts.httpMethods || httpMethods,
preHandler,
config: opts.config || {},
constraints: opts.constraints || {},
handler
})
fastify.route({
url: '/*',
method: opts.httpMethods || httpMethods,
preHandler,
config: opts.config || {},
constraints: opts.constraints || {},
handler
})
There may be an option to disable the wildcard route or to select those to be enabled.
I can do this myself if the idea seems reasonable.
Motivation
If I want to create a route for the /foo
path, I also want Fastify to return a 404 response to the /foo/bar
route, without trying to forward it to the downstream if not wanted.
Example
No response
Metadata
Metadata
Assignees
Labels
No labels