Answer the question
In order to leave comments, you need to log in
Transferring from Express-router to React-router?
Greetings! I am a complete noob in the backend, looking for a reliable solution.
There is a task: to process a request to the domain (all path-parts) using an express router, put cookies there (via res.cookie(key, value)), and then show the frontend, which is made on react and you don’t want to go there at all. This very frontend uses the contents of cookies in the rendering process.
If you simply redirect (res.redirect) to a different port where React is running, then the cookies reach every other time (the browser refers them to domain:port1, then to domain:port2, I think this is a bug).
If it is possible to pull up the react-router handler and throw the request into it - great.
How are such tasks solved?
Parse request with react-router, please don't suggest =)))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question