Nodejs Express Socket IO deployement returns 404 Cannot GET /

My nodejs app contains express server with socket io.

I deployed the nodejs app it worked for few seconds and then all of a sudden it started returning Cannot GET / 404. CORS error is coming while making API calls from frontend.

I redeployed the app to check the same, I was getting header access-control-allow-origin: * for few seconds but after few seconds the header wasn’t there. I think this tells that somehow the requests are not being transferred to nodejs application. I checked the CORS headers here https://cors-test.codehappy.dev/

Git repo: GitHub - deepakpixel/intervyuh-backend

Hi there,

It looks like you changed the CORS option to use callback(null, true); Did this help? To be honest, I’m not sure doing this is any different to doing origin: '*'.

If it didn’t help, I would investigate further why you get the 404 response, I’m thinking this is causing the CORS headers not to be set.

Regards,

Keith
Render Support, UTC+10 :australia:

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