Answer the question
In order to leave comments, you need to log in
Dynamic route in Nextjs?
It is required to implement a dynamic route for displaying products.
Example site.ru/123456?color=5&size=10
Added the following to serverjs
server.get('/:product', (req, res) => app.render(req, res, '/product', {
params: req.params,
}));
Answer the question
In order to leave comments, you need to log in
1. Change the path to the product:
2. Change the location of the paths:
server.get('/some_route', (req, res) => /* ... */);
server.get('/some_other_route', (req, res) => /* ... */);
server.get('/:product', (req, res) => /* ... */);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question