Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configuring CORS asynchronously for express #3612

Closed
michieldewilde opened this issue Dec 16, 2019 · 1 comment
Closed

Allow configuring CORS asynchronously for express #3612

michieldewilde opened this issue Dec 16, 2019 · 1 comment

Comments

@michieldewilde
Copy link
Contributor

michieldewilde commented Dec 16, 2019

Packages used:

  • apollo-server (2.9.13)
  • apollo-server-express (2.9.13)

Expected

By using the applyMiddleware function to connect apollo-server to express you can pass on cors option.
This cors option can be a Boolean or a CorsOptions object.
The apollo-server-express uses the cors package.
This package allows a third option to be passed: CorsOptionsDelegate.
This option allows CORS to be configured asynchronously.
Type definition: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/31483b781ac30f98bdf4d40a517e921f2fc2ce37/types/cors/index.d.ts#L25

For the sake of completion this option should be available.

export interface GetMiddlewareOptions {
    cors?: corsMiddleware.CorsOptions | corsMiddleware.CorsOptionsDelegate | boolean;
}
@tslater
Copy link

tslater commented Sep 14, 2020

Is this merged? Shouldn't this be closed?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants