I am able to pass one parameter and get results from next js api
The docs are very helpful - https://nextjs.org/docs/api-routes/dynamic-api-routes
/api/posts/[postId].js
The above works but is there an option to pass another parameter like below?
/api/posts/[postId][userId].js
The folder name is currently [postId]. I tried renaming it to [postId][userId]
My code for api is
let postVotes = await req.db.collection('votesPosts').count({"post":req.query.postId,"user":req.query.userId})
[postId][userId]there is no separator, the system won't know how to map a url to that route.[postId]/[userId]could do it, and you would have a folder named[userId]withindex.jsor just a file named[userId].jswhere you would fetch the data as you did