maciejtreder / ng-toolkit

:star: Angular tool-box! Start your PWA in two steps! Add Serverless support for existing projects and much more
https://www.angular-universal-pwa.maciejtreder.com
MIT License
1.12k stars 157 forks source link

Server gzipper compressed files on Angular Server side from Firebase #662

Open FotoramaMX opened 5 years ago

FotoramaMX commented 5 years ago

I'm submitting a...


[ ] Bug report  
[ ] Feature request
[x ] Documentation issue or request

In package


[ ] @ng-toolkit/init
[x ] @ng-toolkit/serverless
[ x] @ng-toolkit/universal
[ x] @ng-toolkit/pwa
[ ] @ng-toolkit/firebug

Current behavior

Hi! I'm trying to compress my files with gzipper plugin, but this doesn't works for a universal/serverless mode do you have any idea of this?

Expected behavior

KingDarBoja commented 4 years ago

Hi @FotoramaMX,

You need to install the serverless-api-compression as devDependency. After that, provide serverless-api-compression at your serverless.yml file, at the plugin section like this:

plugins:
    - serverless-apigw-binary
    - serverless-api-compression

And that should do the trick.

Cheers!

FotoramaMX commented 4 years ago

Hi @FotoramaMX,

You need to install the serverless-api-compression as devDependency. After that, provide serverless-api-compression at your serverless.yml file, at the plugin section like this:

plugins:
    - serverless-apigw-binary
    - serverless-api-compression

And that should do the trick.

Cheers!

Thanks so much! so this configurations works for a Firebase Deploy?

KingDarBoja commented 4 years ago

@FotoramaMX Not sure to be honest, the serverless-api-compression package only works for AWS as stated on npm readme:

Serverless plugin that enables/disables content compression setting in API Gateway

But looks like Firebase already has gzip compression as I read on this StackOverflow.