NextJS URL multiple parameters passing #14314
Unanswered
saresh-krish
asked this question in
Help
Replies: 1 comment
-
I think you'd want to do something like... server.get('/app/file/:id/:subject', (req, res) => {
return app.render(req, res, '/app/file', { ...req.params, ...req.query });
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
I am using import { useRouter } from "next/router";
Currently what I am getting is.
http://localhost:3000/app/file?id=abc35a5e-1234-9644-acb3-0242ac760002&subject='1234'
What I need
http://localhost:3000/app/file/abc35a5e-1234-9644-acb3-0242ac760002/1234
I do not want parameters name on Url .
Routing Link
<Link href={
/app/filel?id=${id}&subject=${"1234"}} >
Server File:
server.get('/app/file/:id/:subject', (req, res) => {
return app.render(req, res, '/app/file', { id: req.params.id, subject: req.params.subject });
});
### System information
OS: Linux
Browser : Chrome
"next": "^9.3.4",
"react": "^16.13.1",
Beta Was this translation helpful? Give feedback.
All reactions