在根目录创建proxy.config.json文件,写入:

{
  "/api": {
    "target": "http://yourIP:8888",
    "secure": false,
    "logLevel": "debug",
    "pathRewrite": {
      "^/api": ""
    }
  }
}

在启动时,加上参数: --proxy-config proxy.config.json

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

相关文章:

  • 2021-04-06
  • 2022-12-23
  • 2022-12-23
  • 2021-07-31
  • 2021-06-09
  • 2022-12-23
猜你喜欢
  • 2022-03-04
  • 2022-12-23
  • 2021-08-06
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
相关资源
相似解决方案