简体   繁体   中英

React.JS app on one server and Java API, Ubuntu, Apache Tomcat 9 Web server on second server

I have a react, Java API application on Apache Tomcat 9 server on same server. I want to separate React.JS UI into one server and Java API onto second server. Server OS is Ubuntu 20.

I am facing below challenges, need your help to complete POC project:

How to develop and build and deploy React.JS, NODE.JS app on first server to point to Java API, Apache Tomcat 9 on second server.

Please suggest how to resolve these issues or any article's to read to resolve the issue.

So you'll have two servers:

  • first, with FrontEnd, handled by NodeJS (or even Nginx, why not?)
  • second, with BackEnd, handled by Tomcat

Your FE should have a configuration with host of BE. Such a configuration is usually made with environment variables. That will cause a request coming from user's browser to NodeJS, then using environment variable the request will be passed through NodeJS to BE.

Another option, FE may go to BE directly, but that will cause FE and BE worknig on different hosts, so that you'll have to configure CORS on your BE.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM