-
-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proxy to external API #482
Comments
Regarding the subject: Is there a way to update an existing app created with react-create-app 0.2.0 to version 0.3.0 ? |
Hi! Sorry for the trouble. There is a note above this section in README:
You are likely using 0.2.1 because it is the latest stable version. Please wait for 0.3.0 to come out. |
This question is answered here: #485 (comment). |
I have now also tried setting up a simple HTTP Python server locally so I can monitor requests to that, and the proxy now looks like this:
And the request I do from the app looks like this:
And now I get the response:
But monitoring the :8000 local server, no requests at all comes through, so it does not proxy the requests though there. |
Ok, that's too bad. I didn't check the version, just assumed 0.3.0 vas the latest. Perhaps add that at the top of the instructions? =) |
README generated in your project shouldn't have this section. |
By the way, you can use |
@gaearon That amendment is very good, makes it a whole lot clearer |
It should work against a remote domain. Actually I think I'll go ahead and backport this to 0.2.x since many people are asking for it, and 0.3.0 is a bit delayed. |
@gaearon I can try it out against an external url as soon as you have! Or if you can point me to what I should change in order to try it out. |
@gaearon I had to add |
Hmm, it should be there, is it not? |
0.2.3 is released and contains this. If something doesn’t work please file an issue, preferably with a project reproducing it. |
@gaearon thank you, I missed it! |
Hi! I have some questions about this and I'm a bit lost. I know how to set the
Thanks! |
In the README there are instructions on how to set up a proxy for API requests in development. I have followed those instructions and it does not work as expected.
I have set up my proxy like so:
In the packaage.json and this eliminates the CORS error I get before I added the proxy config, but the request to the API is not working. In a component I am doing a
fetch()
to the address/api/recent.json
which I would then expect to result inhttp://test.example.com/api/recent.json
and I have tested that address and it works, but I get a 404 in the web console, sayinghttp://localhost:3000/api/recent.json
can't be found.Am I missing something or should this not work?
The text was updated successfully, but these errors were encountered: