Giter Site home page Giter Site logo

Comments (5)

brettstack avatar brettstack commented on May 9, 2024

This is due to gzip which only triggers after 1KB. You need to configure binary data correctly.

Add in text/html to your binaryMimeTypes; ensure text/html is configured on your API Gateway API binary mime types and redeploy.

from serverless-express.

BerndWessels avatar BerndWessels commented on May 9, 2024

Thanks @brettstack
Where and how in API Gateway (I'm using the console or terraform) do the mime types have to be configured for that to work?

from serverless-express.

brettstack avatar brettstack commented on May 9, 2024

I'm not familiar with Terraform API. In Console you can click on your API and then click Binary Support in the left side nav. Ensure the list matches what you specify in binaryMimeTypes. Alternatively, specify / in API Gateway console and list your content types just in your Lambda function. Support for / in the aws-serverless-express lib is coming #70

from serverless-express.

BerndWessels avatar BerndWessels commented on May 9, 2024

Thank you @brettstack

That is working now.

Maybe we can add a more detailed documentation to the README. I'm pretty sure this is a common problem people will run into.

By the way, if the page body is actually less than 1kB, would that still work?

from serverless-express.

brettstack avatar brettstack commented on May 9, 2024

Yes it will continue to work for <1KB.

Agreed, the documentation can be improved. I will do that along with #70.

from serverless-express.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.