How to get search params inside API app directory
Answered
Vojin posted this in #help-forum
VojinOP
In a page file I'm be able to something like this:
But inside api I can't get any data from request outside of query params. If I get the whole path, I can manually extract the params, but am wondering is there any smarter why?
function Home({ params }: { params: { id: string } }) {
console.log(params.id);
} But inside api I can't get any data from request outside of query params. If I get the whole path, I can manually extract the params, but am wondering is there any smarter why?
Answered by Giant panda