CORS - Policy Problem
here is my Node App code
app.use(
cors({
origin: '*',
optionsSuccessStatus: 200,
credentials: true,
methods: 'GET,PUT,POST,DELETE',
})
);
19 Replies
what framework
express?
yes sir
oh your app is not even up
thats why
With this same settings It works in Local Server.
can you send deploy logs for the railway app
wait a minute sir
It says Active
can you send the code where you call
app.listen()
change the end to be
deleted the image bc you had secrets in it btwsorry, I don't get it. where I change and what?
change the last part of your code to that
delete everything after
// Server
and paste that insteadok ok
Done but I think the code quite same
try redeploying it now
should work
yup cors is active now
yesss
but how?
you were listening on
port
but you should have been listening on PORT
uppercase lettersohh, Thanks. I put my local variable in .env in lowercase, that's my mistake, thanks for your valuable time sir.
np, glad it works now