So I am using Adonis 4.1 in combination with React on the front-end for my web app.
However, the bundled version of my React file is pretty heavy and I would like to GZIP encode my asset file in order to reduce loading time on mobile phones. I created a middleware like this:
However, this gives me a browser error:
I figured the content must not actually be encoding properly but how do I fix that? The docs of
zlib is somewhat poorly written and not much of a help when it comes to understanding how to use in a Node.js framework environment.