I have a proxy config file which has API(web service) link to target to make calls to our database. This proxy config is working fine locally using npm start .
Now I Need to deploy this app to our production windows server on IIS. I used ng build and ng build --prod looks like this is not generating build with proxy setting. I need help that How I can generate a build with proxy setting so that I can deploy it to prod server.
Api is deployed on some other domain and this angular app will be deployed on some other domain.
Thanks
The proxy config file is for the local development web server. The main reason you use it is so you can avoid cross domain requests when developing the Angular app and the api on your local machine without having to allow cross domain requests in the api.
When you release to production there is no support for the proxy config file. You will be releasing to your production web server.
If your api is hosted under the same domain then there is no need for proxying requests as they are not cross domain and if the api is on another domain you will need to allow cross domain request in the api.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With