Skip to content

Cors errors Nodejs + Angular + Railway Deploy #4676

Answered by darrachequesne
torresmald asked this question in Q&A
Discussion options

You must be logged in to vote

Hi! I think it's origin, not origins in the cors option:

const io = require('socket.io')(htpp, {
  cors: {
    origin: ["http://localhost:4200"],
    credentials: true,
    allowedHeaders: ["my-custom-header"],
  }
});

Reference: https://socket.io/docs/v4/server-options/#cors

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@torresmald
Comment options

Answer selected by darrachequesne
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants