-
I have the following layout in my /server/api directory I was hoping that if someone hit the /api/db/collection/ url that the [...] catchall would be hit. Instead what I'm seeing is that [id].get.ts is called with id set to an empty string. Not sure if there is a better way or if this might be an issue. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Right after posting I thought to try an alternative. This works great if I GET /api/db/collection (without the trailing slash) In this case db/[collection].get.ts is called. If I have a trailing slash... /api/db/collection/ invokes db/[collection]/[id].get.ts with an empty string for id I think ? I"m doing it right, but not 100% sure. Any suggestions appreciated. I'm going to mark this as answered. |
Beta Was this translation helpful? Give feedback.
Right after posting I thought to try an alternative.
This works great if I GET /api/db/collection (without the trailing slash) In this case db/[collection].get.ts is called.
If I have a trailing slash... /api/db/collection/ invokes db/[collection]/[id].get.ts with an empty string for id
I think ? I"m doing it right, but not 100% sure. Any suggestions appreciated. I'm going to mark this as answered.