angular-cli启动代理

来源:互联网 发布:淘宝生意参谋多少钱 编辑:程序博客网 时间:2024/06/02 18:36

1.新建一个配置文件

proxy.conf.js (文件名称)


{

"/api" : {

"target" : "http:localhost:8989",

"secure": false

}

}

2.启动

ng serve --proxy-config proxy.conf.json



github链接: https://github.com/angular/angular-cli/pull/1896/commits/a81aa3b6117848a1c9c99d3b6d0666433b5144e0

原创粉丝点击