Next.js Discord

Discord Forum

Log API route template without variable replacement?

Answered
Devon Rex posted this in #help-forum
Open in Discord
Devon RexOP
If it have a @api/[foo]/[bar]/[baz]/route.ts, and I make a request to api/10/20/30, is there a way to get the url template instead of the substituted values?
Answered by Devon Rex
Nevermnd, I've found that it's not possible out of the box.

https://stackoverflow.com/questions/66792515/get-current-route-in-next-js-api-route
View full answer

1 Reply

Devon RexOP
Nevermnd, I've found that it's not possible out of the box.

https://stackoverflow.com/questions/66792515/get-current-route-in-next-js-api-route
Answer