我有一个Angular应用程序和一个Web API。要在本地进行测试,我使用一个代理配置文件:proxy.conf.json
{
"/api": {
"target": {
"host": "localhost",
"protocol": "http:",
"port": 50565
},
"secure": false,
"changeOrigin": false,
"logLevel": "info"
}
}
一切正常。最近我更新到ng6。从那时起,我得到以下错误:
[HPM]尝试将请求/ api / data / GetCurrentUser /从localhost:4200代理到http://localhost:50565(ECONNREFUSED)时发生错误
知道这里发生了什么吗? (我使用ng serve --proxy-config proxy.conf.json)
答案 0 :(得分:1)
请尝试