CORS error communicating to Render hosted API and Front-end

I have a front-end Vue app and a back-end NodeJS app both hosted on Render.

Trying to make a login request on my web app throws a CORS error.

I have set the Allow-Access-Control-Header to my front-end as seen in the screenshot below so i cant see why this isn’t working.

tFJZrCBUhP

Anyone have any ideas?

Just going to leave this solution here in case anyone stumbles upon the same issue.

As stated in this question:

https://community.render.com/t/cors-axios-call-from-static-site-to-express-js-backend-blocked/3460

removing the port from the URL connection fixed the issue. My API is served on port 3000 and i had this in the connection string. Removing it fixed all issues

Thanks for following up with your solution Chris,

I’ve also made another suggestion via the support ticket you opened about this too :wink:

Regards,

John B

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