DEV Community


Discussion on: How to deploy React Application on IIS Server

sumitkharche profile image
Sumit Kharche Author • Edited

The proxy feature isn't meant for production. Proxy is most suitable in the Development environment but when you deploy your app with prod mode on a web server then you need to do it in different ways.
Few links for your references:

One way you can do it by using the environment variables.

so for development create file .env.development outside of src folder and add your API URL like:

REACT_APP_API_BASE_URL='<your local api url>'

For Production create file .env outside of src folder & add your Prod api base url like above.

once you configure your API URLs you can simply use it in your as App as below:


I hope this solves your problem. Please let me know if any queries.