-
Notifications
You must be signed in to change notification settings - Fork 34
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
Support minimumCompressionSize input #26
Comments
We currently don't have this built in at the API Gateway level, but you could achieve this by returning the right headers in your express app code. Here's an example from the fullstack-app template https://github.com/serverless-components/fullstack-app/blob/master/api/app.js#L28-L35 |
Thanks, I had the cors npm package installed so I performed a redeploy and it started working. I think I had some manually configured CORS settings on the gateway from testing that must have been interfering. How about support for compression? I am porting some code from aws-serverless-express and compression seems to be the only part that isn't working anymore. I've seen some examples in serverless.yml to add the following but I'm guessing the component only supports the input options specified in the documentation. provider: |
@BrandynThornton how do you think that would look like with component? a new input maybe? |
Yea a new input seems like the most straight-forward approach. I'm very new to the serverless framework but I think a more powerful solution would be to support configuration options from providers such as https://www.serverless.com/framework/docs/providers/aws/events/apigateway/#compression in a component context. Perhaps it's possible to merge that configuration with the internal component resources' configuration. I understand that would be breaking the clean abstraction that components provide so it probably isn't ideal but it enables a lot of the more complex scenarios. I'm not sure if this even makes sense in a serverless.yml file but this was my first intuition after reading the non-component documentation.
|
Sounds good. I just rephrased this issue. I think we can add this in. |
Hello,
I would like to set cors: true on my httpApi resource, is this possible using the component?
Thanks
The text was updated successfully, but these errors were encountered: