Running Angular 4 app using a JSON server

血红的双手。 提交于 2019-12-05 19:28:53

I have backend service running on port 5005, and app running on 4200, in order to "talk" with each other I have set up proxy.config.json file which looks like this

{
  "/api/*":{
    "target":"http://localhost:5005",
    "secure": false,
    "logLevel": "debug"
  }
}

and when I serve my app I run ng serve -open --sourcemap=false --proxy-config proxy.config.json command.

You can also try to do something like this.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!