September 2017
Intermediate to advanced
450 pages
11h 24m
English
Being able to serve our Angular content under the same domain as our web server is very useful in a production environment, but if you are doing local development, the cycle of rebuilding and redeploying the web server can be a tedious process.
Luckily, Angular-CLI offers tools to proxy services on other ports in your local environment so that you can continue to work in Angular-CLI while still connecting to an API as though it were served on the same domain. To do this, you must create a proxy configuration in the root of your Angular-CLI project called /proxy.conf.json.
{ "/api": { "target": "http://localhost:3000", "secure": false }}Now, when you start Angular-CLI, simply provide that path with the proxy-config option: ...
Read now
Unlock full access