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

Automatic Compression #178

Merged
merged 7 commits into from
Mar 24, 2021
Merged

Automatic Compression #178

merged 7 commits into from
Mar 24, 2021

Conversation

AndrewBarba
Copy link
Contributor

Automatically compress responses based on the Accept-Encoding header:

const api = require('lambda-api')({
  compression: true
})

@jeremydaly
Copy link
Owner

Hey @AndrewBarba, thanks for your work on this. Adding the zlib library breaks the ZERO DEPENDENCY rule, plus the package has been deprecated because the functionality has been rolled into Node.js CORE: https://nodejs.org/dist/latest/docs/api/zlib.html

I'm going to work on refactoring this and merging it into the main branch without the extra dependency.

@jeremydaly
Copy link
Owner

FYI, moving this work into a new zlib branch. https://github.com/jeremydaly/lambda-api/tree/zlib

@AndrewBarba
Copy link
Contributor Author

@jeremydaly I didn't add any deps, this is using zlib built into Node.js

@AndrewBarba
Copy link
Contributor Author

AndrewBarba commented Mar 24, 2021

Curious why you think I added a new dep in the first place. Is something off in the git diff?

@jeremydaly
Copy link
Owner

🤦‍♂️ Sorry about that! I just saw the require and my mind went right to a new dependency. I'll get this merged right now.

@jeremydaly jeremydaly merged commit de4a562 into jeremydaly:master Mar 24, 2021
@jeremydaly
Copy link
Owner

This is failing on Travis because the node version is still at 8. 😬

Updating that now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants