How to proxy API requests to another server?


The officially recommended approach is now the one documented here


Better documentation is now available and you can use both
JSON and JavaScript based configurations: angular-cli documentation proxy

sample https proxy configuration

  "/angular": {
     "target":  {
       "host": "",
       "protocol": "https:",
       "port": 443
     "secure": false,
     "changeOrigin": true,
     "logLevel": "info"

To my knowledge with Angular 2.0 release setting up proxies using .ember-cli file is not recommended. official way is like below

  1. edit "start" of your package.json to look below

    "start": "ng serve --proxy-config proxy.conf.json",

  2. create a new file called proxy.conf.json in the root of the project and inside of that define your proxies like below

       "/api": {
         "target": "",
         "secure": false
  3. Important thing is that you use npm start instead of ng serve

Read more from here : Proxy Setup Angular 2 cli

Leave a Comment