Ask Your Question
2

What is the solution for hosting multiple React SPA apps on one ASP.NET Core website?

asked 2023-06-30 16:02:19 +0000

woof gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-06-30 16:20:01 +0000

devzero gravatar image

One solution is to use ASP.NET Core's built-in support for client-side routing and serve the React apps as static files. This can be achieved by configuring the ASP.NET Core middleware to serve static files from a directory where the React apps are built.

To differentiate between the multiple React SPA apps, you can use different routes for each app. For example, you can serve the first app on the root route ("/") and the second app on a separate route ("/app2").

Another solution is to use a reverse proxy to forward requests to the appropriate React app. In this approach, you can configure the reverse proxy to inspect the request URL and route it to the appropriate app based on a predefined routing rule.

Overall, the approach you choose will depend on the specifics of your project and your requirements for scalability, performance, and maintainability.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-06-30 16:02:19 +0000

Seen: 10 times

Last updated: Jun 30 '23