Skip to content

CORS configuration ineffective. #2554

Answered by clhome
clhome asked this question in Q&A
Apr 25, 2023 · 6 comments · 11 replies
Discussion options

You must be logged in to vote

I have found a solution to fix the CORS issue, but it's not elegant. I believe the server.ts configuration not working should be considered a bug.The code is written in server.ts.

var cors = require('cors');
var corsOptions = {
  origin: '*',
  credentials: true,
  optionsSuccessStatus: 200
}

app.use(cors(corsOptions));

it need run“yarn add cors” first,

Replies: 6 comments 11 replies

Comment options

You must be logged in to vote
3 replies
@JarrodMFlesch
Comment options

@clhome
Comment options

@VadBe
Comment options

Answer selected by clhome
Comment options

You must be logged in to vote
3 replies
@sandros94
Comment options

@LuisFernandoLG
Comment options

@isaackoz
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@remarcable
Comment options

@remarcable
Comment options

@dbersan
Comment options

@remarcable
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

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

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