React Get Api from Flask Url Backend

app.config[‘SQLALCHEMY_DATABASE_URI’] = ‘postgresql://postgres:test@localhost:5432/FinalProject
that was my config in local and since the flask was working on port 5000 in my frontend i was using const API_URI = ‘http://localhost:5000’; and then my url comes like const API_URI = ‘http://localhost:5000’/getBikes/fromAll’.But now i get this error’failed to load response no found data given for resource error’.My frontend(react)-static website,backend(flask)-webservice,and postgresql are seperated .I use internal database uri in flask ,external in react i also handled with cors
.It is school project and this is first time i use render.com.Can somebody help me on that what exactly should i put the uri part in my both frontend and backend seems mine’s are not working i am probably following something wrong even though i followed the documentation i think i am missing something

Hi there,

For your backend and the SQLALCHEMY_DATABASE_URI you should use the internal connection URL of your Postgres service. Please don’t hardcode this into your application source code, especially if you use a public Git repo. Use an environment variable to store this value.

For your frontend to know the URL of your backend you should use the onrender.com domain assigned to your backend service.

Regards,

Keith
Render Support, UTC+10 :australia:

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