Configuring the client proxy -- Angular App --> CLI dev server -- >Rest Server

时间:2021-06-13 09:48:05   收藏:0   阅读:0

技术图片

 

 In Dev mode,

1 你想利用CLI的Hot reload features 和快速Rebuild application bundles in memory.

2.和发请求给Rest Server.
那么,你需要配置代理来来改善你的开发体验。

实现步骤:
1.新建 proxy-conf.json
{

"/api": {
      "target": "http://localhost:8000",               -- redirect requests to you rest server.
      "secure": false                                         -- v>The target connection doesn’t need SSL certificates.
      }
}
2. Change scripts to add your command scripts.

技术图片

 

3.npm run dev

 



评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!