E
E
EchoStan2018-01-30 11:47:41
JavaScript
EchoStan, 2018-01-30 11:47:41

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

1 answer(s)
E
EchoStan, 2018-01-30
@EchoStan

there is a front on the react, from where you want to take out welcome cookies, business logic and analytics for locales to the “other front”, to another router. and then send the user to a specific react router root.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question