Closed patrickett closed 2 years ago
in this way your route match /projects/
if you want to match /projects
you should call your file 'project.ts'
like this:
.
├── projects
│ └── {id}.ts
└── projects.ts
or use the option ignoreTrailingSlash https://www.fastify.io/docs/latest/Reference/Server/#ignoretrailingslash
i do not suggest last options
projects
and projects/
are different routes:
some examples:
https://www.slimframework.com/docs/v3/cookbook/route-patterns.html
ignoreTrailingSlash
does exactly what I need it to. Thanks!
Thanks to you!
I am running into an issue when trying to use a structure like this:
This will get mapped to
www.example.com/projects/
Which means trying to use query parameters with the url
www.example.com/projects?case=abc123
will return:From my understanding of searching the issue, people tend to lean toward the idea where non trailing slash urls ex.
/project
provide a resource. Where urls that do provide the trailing slash ex./project/
are more synonymous with directories.I think this might cause issues for existing implementations, but I think making it more consistent or some way of expressing when a trailing slash is included is important. Specifically so that in the case above we can use query parameters.