-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
CORS helpers #520
Comments
Research of cloud provider API gateway pulumi configs: AWS:
Azure:
GCP: TLDR AWS and Azure seem fine, however considering GCPs lack of support (and lack of a roadmap) Like we have suggested, we could use a load balancer or just handle it on our side, but then if we do this should we just do it consistently across any new provider or pick best prac per cloud? |
Reviving this feature for v1. Cleaned up this issue, research was done last year as seen above. Example in ts: // no cors by default
const helloApi = api("main");
// with custom settings
const helloApi = api("main", {
cors: {
allowOrigins: ["https://cors-test.codehappy.dev"],
allowCredentials: true,
allowMethods: ["GET"],
allowHeaders: ["*"],
maxAge: "3 days",
},
});
// with default cors settings
const helloApi = api("public", {
cors: true,
}); Implementations:
Old pre v1 reference work to use: |
While CORS can currently be handled using middleware and by registering OPTIONS routes, we'd like to build this support into the framework to make it more convinient and ideally handle the responses as high up the infra stack as possible. For example, providing support for static responses to OPTIONS requests at the API Gateway or Nitric Server layers to reduce latency and hosting costs.
This support will be needed in all language SDKs.
The text was updated successfully, but these errors were encountered: