CORS - Policy Problem
In local server(node and react are in different port), it works fine; but when I request from railway this happen.
I have installed npm cors;
const cors = require('cors');
app.use(cors());
9 Replies
Please provide your project ID or reply with
N/A
. Thread will automatically be closed if no reply is received within 10 minutes. You can copy your project's id by pressing Ctrl/Cmd + K -> Copy Project ID.No project ID was provided. Closing thread.
set origin as *
app.use(cors({
origin: * ,
optionsSuccessStatus: 200,
credentials: true
}))
don't forget to change origin when you are ready to deploy your frontend
I think, you mean "*", Ok let me try
Brother this is still usolved. help me
Ok so then this is specifically a railway app issue then?
ideally you should be setting your frontend url as the origin and not the * because thats crazy unsafe
having the same exact issue man
as if hosting isnt annoying enough
That's CORS, nothing to do with railway itself, what about you open your own thread and we try to help you?
Thought it did considering its only an issue when hosting. Looks liek the same exact problem but will do 👍
just made it
I'm not at home rn i'll see that thread when possible :salute:
I'm sure someone will help u till then
no worries, I gtg to work too. Thanks :salute: