angular 开发之proxy

创建proxy配置文件proxy.conf.json
内容如下 
{
 
"/api/*": {
"target": "https://abc.com",
"changeOrigin": true,
"secure": false
}
}
 
然后在npm的package.json启动的参数--proxy-config中加入
"start": "ng serve --host 0.0.0.0 --port 4300 --proxy-config proxy.conf.json",
posted on 2018-04-24 16:06  yoyo002  阅读(258)  评论(1编辑  收藏  举报