reactjs – Can I use same Node.js server to serve React apps and use it as proxy to make API calls?

My task is to develop a simple website for company domain use. I followed a guide for creating a React app in Visual Studio code. Basically, I created two servers. One for API calls and one to serve the React app.

What I learned until now by reading and following examples online is that often in React API calls for resources are made from client JavaScript in the browser. In .NET MVC, for example, I’m used to making all API calls and getting all external resources from the server side (from Controllers and Actions ). I’m returning JSON to the client side and I use different JavaScript libraries to build the UI. So my questions are:

  • Is it OK to serve my react files and all static files (HTML, CSS, JS, etc.) from the Node.js server the same way as I do using IIS?

  • Is it ok to use the same Node.js server as a proxy for API calls?

  • Should I just serve my React UI from .NET MVC and IIS and use Node for external API calls?

Read more here: Source link