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

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

 

 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.

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

 

3.npm run dev

 



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

上一篇:HTML中css和js链接中的版本号


下一篇:[iOS]定时器NSTimer、CADisplayLink的内存管理