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

前端 未结 6 1469
忘了有多久
忘了有多久 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:18

    If your on a newer version CRA 2.0+ you'll need to do this via a manual proxy. https://facebook.github.io/create-react-app/docs/proxying-api-requests-in-development#configuring-the-proxy-manually

提交回复
热议问题