Transmission via REST API framework to React-Redux?

Transmission via REST API framework to React-Redux c localhost on different ports.
Django framework running on 8000 port and generates API.
And React-redux app running on 3000 port. And the failure is not taking api giving error 404
June 5th 19 at 21:18
2 answers
June 5th 19 at 21:20
Solution
You can use nginx. Insert in /etc/hosts host applications:
127.0.0.1 my-app

In nginx.conf in the section server:
server {
 listen 80;
 server_name my-app;

 location ^~ / {
 proxy_pass http://localhost:3000/;
}
 location ^~ /api/ {
 proxy_pass http://localhost:8000/api/;
}
}


Refer to the application in the browser as my app and the API in the application to /api.
Okay, try it when you deploy. But while I was able to solve the problem using django-cors-headers, disabling CORS.
https://github.com/ottoyiu/django-cors-headers/ - Keon commented on June 5th 19 at 21:23
June 5th 19 at 21:22
Hard to understand whether You have tadalail their apps ( and this is dev or prod), but with CORS, all right
This is dev, in production will have to study how the api works - Keon commented on June 5th 19 at 21:25

Find more questions by tags APIDjangoReactRedux