#CORS - Hosting request header problems

31 messages · Page 1 of 1 (latest)

boreal tundraBOT
#

Project ID: 87f56f88-5de7-4a88-8ed9-9e3f3af4ea9f

ornate meadow
#

87f56f88-5de7-4a88-8ed9-9e3f3af4ea9f

#

and then in my local dev this is what I get back instead.

blissful hazel
#

watch out for the frontend url, if it includes any slashes at the end it'll fail

ornate meadow
#

yep, triple checked that

#

it would also show me in the error console whta the frontend url is

blissful hazel
#

but wait, is your service even reachable? i see you're getting 503

#

try going to your backend url directly

ornate meadow
#

Gtg drive ot work rq but ill be back in a few. ill see about that ^

blissful hazel
#

yeah your app somehow is not even responding

ornate meadow
#
app.listen(process.env.MYSQL_PORT || 3001, '0.0.0.0');
#

not sure if these build logs would be causing the issue?

blissful hazel
ornate meadow
#

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?

blissful hazel
#

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')

ornate meadow
#

its not in my variables when i made the service

blissful hazel
#

it's automatically provided so it doesn't show in the service's env variables

ornate meadow
#

🤦

#

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