M
M
MaximPatrushev2019-05-30 16:07:21
React
MaximPatrushev, 2019-05-30 16:07:21

How to organize routing between two react applications on the same domain?

There are two react applications - the first is responsible for the 'user' interface of the system, the second is for the 'admin panel'. Both applications work on the same domain, the first application is available at, say https://some.domain/, and the second - https://some.domain/admin
In the first application, you need to add a link to go to the admin panel, but the problem is that the routing looks like this:

<Route path="/" exact component={Page1} />
<Route path="/page2" component={Page2} />
<Route path="/page3" component={Page3} />
<Route component={NotFound} />

That is, for all paths that do not have a route, a special 404 error page is displayed.
If you just add <Link to="/admin">Ссылка</Link>, then this link will also be treated as an unknown route. How to make a transition?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Spirin, 2019-05-30
@MaximPatrushev

<a href="/admin">Admin</a>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question