Skip to content

what should I expect with server routes having parameters and a catchall? #324

Answered by sig9
sig9 asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@OptimusePrime
Comment options

@sig9
Comment options

@sig9
Comment options

Answer selected by sig9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants