Can't make request to backend from static frontend

I am re writing the /api request but still, its making the request on frontend URL.

Hi,

That should work if the rewrite destinations are valid.

Could you share the whole /api/* rewrite destination?

Alan

https://infinity-connnect-api.onrender.com/

also it is working fine if I am running the frontend code from localhost

There will always be differences between environments: development mode/Local, production mode/Render, etc. These differences need to be considered and configured as required for your own app in each environment.

Please could you share the whole /api/* rewrite “destination”? It’s not complete in your screenshot.

Alan

https://infinity-connnect-api.onrender.com/
this is the rewrite destination , I already shared

Ok, then that would be likely be incorrect.

If you want to pass the static site /api/* to https://infinity-connnect-api.onrender.com/ then you need to pass the wildcard on.

E.g. the destination may be something like https://infinity-connnect-api.onrender.com/api/*

Alan

I tried that too. But still tried now, its not working

Again, please share what you’ve got set.

Alan

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.