#CORS - Hosting request header problems
31 messages · Page 1 of 1 (latest)
87f56f88-5de7-4a88-8ed9-9e3f3af4ea9f
and then in my local dev this is what I get back instead.
watch out for the frontend url, if it includes any slashes at the end it'll fail
yep, triple checked that
it would also show me in the error console whta the frontend url is
but wait, is your service even reachable? i see you're getting 503
try going to your backend url directly
Gtg drive ot work rq but ill be back in a few. ill see about that ^
yeah your app somehow is not even responding
go through this docs https://docs.railway.app/guides/fixing-common-errors
interesting. Followed the docs and fixed up my server to this however the aplication still fails to respond
app.listen(process.env.MYSQL_PORT || 3001, '0.0.0.0');
not sure if these build logs would be causing the issue?
why are u listening on a mysql port?
ngl, I dont even know lol I dont know what other port im supposed to be listening on other than 3001 for local production. Is there a port that im missing that railway provides like 3306?
as mentioned in the docs, railway provides a env PORT. that's where you shoud listen
so your code should look like this
app.listen(process.env.PORT ?? 3001, '0.0.0.0')
where?
its not in my variables when i made the service
it's automatically provided so it doesn't show in the service's env variables
🤦
alright lemme try that
changed it to PORT, still failing
wait...i think its working
thats so weird, even after its done building it still takes a few minutes to register
gonna hit the hay but im pretty sure that solved the problem, if not ill post again in here. Thanks for helping a backend noob friend 👍 @blissful hazel