angular proxy config not working

后端 未结 2 1379
眼角桃花
眼角桃花 2021-01-16 21:16

i don\'t understand where i am wrong .

ps. already try to fix by this answer but still not working

Angular-CLI proxy to backend doesn't work

Con

2条回答
  •  -上瘾入骨i
    2021-01-16 21:26

    change

    {
      "/api": {
      "target": "http://localhost:1234",
      "secure": false,
      "changeOrigin": true,
      "logLevel": "debug"
      }
    }
    

    to

    {
      "/api": {
      "target": "http://localhost:1234",
      "secure": false,
      "changeOrigin": true,
      "logLevel": "debug",
    "pathRewrite": {
          "^/api": ""
        }
      }
    }
    

提交回复
热议问题