Do I have the right URL and CORs Config? If so, why the error? #932
Unanswered
tim-rohrer
asked this question in
Q&A
Replies: 2 comments 4 replies
-
You need to use your exposed URL for your api: const response = await axios.post('http://my-api.yourdomain.com/api/fetch', rqstPackage); |
Beta Was this translation helpful? Give feedback.
1 reply
-
If you have your API and your frontend code open source, post it here and we can look into that. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I thought I'd try out this new feature.
Here is the relevant code in my API that has been deployed to my Caprover server as
srv-captain--my-api
. It should be listening on port I have specified.In my front-end React code, I'm calling this using:
const response = await axios.post('http://srv-captain--my-api:[port]/api/fetch', rqstPackage);
But I continue to get the errors:
I recognize the problem may simply be that I have the cors setup wrong (I thought what I had would be fully permissive), but I am also looking for a confirmation that I am reading the errors correctly, and that I have the
axios
call correct?Beta Was this translation helpful? Give feedback.
All reactions