React Proxy error: Could not proxy request /api/ from localhost:3000 to http://localhost:8000 (ECONNREFUSED)

前端 未结 6 1484
忘了有多久
忘了有多久 2021-01-17 08:02

I have a React frontend that uses jwt to authenticate with the Django backend. The backend works and is connecting just fine using django views, but when I try to proxy a r

6条回答
  •  情书的邮戳
    2021-01-17 08:11

    I faced a similar issue but in Mac machine. I changed localhost to 127.0.0.1 in the package.json and that worked for me as below:

    "proxy": "http://127.0.0.1:5000"
    

提交回复
热议问题