Hi,
I followed steps from tutorial, but I can’t connect /api calls to my express Web Service.
My project is at:
Instead of redirection, I added 2 env variables:
REACT_APP_HOST: …
REACT_APP_PORT: 4001
so i get a call: https://support-knowledge.onrender.com:4001/api/test
but I always get the response:
net::ERR_CONNECTION_TIMED_OUT
In my Web Service shell I tried:
curl -X POST 127.0.0.1:4001/api/test
and received the response: ‘Welcome to GeeksforGeeks’
You can also use rewrites to achieve what you’re trying to do with hitting the backend with a frontend URL. Add a source of /api/* a target of https://your-backend-api.onrender.com/api/* with the action as rewrite.
Hi Alan,
Thanks for suggestions.
My site is: https://support-knowledge.onrender.com/
I found solution for my /api/* calls, setting my Web Service link to ‘Rewrite rules’:
The port you specify is only for internal communication between the Render proxy and your service instance (or between service in your account). Public URLs only respond to HTTPS, port 443, which doesn’t need to be specified as it’s the HTTPS default.
Hi @SlavkoPar , could u please tell how were u able to remove deceptive site ahead warning from your website? When i deployed my service onrender.com, after few minutes i started getting this warning and i am not sure what caused it as the project was for purely personal project purpose… any advise would be much appreciated.