a year ago
After much ado I got my server, db, and front end connected and working (at least locally). I took a break and returned to the project to find that I'm now getting 502 errors when I fetch, with "No 'Access-Control-Allow-Origin' header" present.
I have tried a variety of CORS options to troubleshoot without any luck. I can't figure out for the life of me why it was initially working in Postman and locally, but not after it was pushed to production. Is there some sort of migration that happens/happened when the server was deployed?
Prior to adding verbosity to my CORS configuration, I only had app.use(cors()) in my server. I am only sending GET and POST requests from my frontend.
2 Replies
a year ago
Your service is currently crashed, a crashed service can not respond to requests.
Please review your deploy logs for the crash reason.
Additionally, make sure your domain is pointing to the correct port.
a year ago
After some changes I have been able to get everything running (i.e. not crashed). I am now having an issue with the database connecting over the public network. I feel like all of the ports are lined up but I am receiving this prompt and am not sure why there are now undefined variables:
mysql -hundefined -uroot -p******** --port undefined --protocol=TCP railway
Additionally, the hostname does not seem to be resolving in my server code. I have added the "sleep 3 ..." to my package.json but am still receiving the "getaddrinfo" error.