更新时间:2022-01-15 07:15:19
假设您的快速站点在localhost:3500
上运行,并且所有api调用均以/api
Suppose your express site is running on localhost:3500
and all api call begins with /api
使用内容创建proxy.conf.json
create proxy.conf.json with the content
{
"/api": {
"target": "http://localhost:3500",
"secure": false
}
}
然后编辑package.json
并将"start": "ng serve",
更改为"start": "ng serve --proxy-config proxy.conf.json"
现在使用命令npm start
运行项目.注意:- ng服务将不起作用
now run the project using command npm start
.Note:- ng serve will not work
有关更多信息,请找到文档化在这里
For more information find documatation here