I'd like to improve the loading speed of my website and read online that gzipping would help reduce the file size. However, if I add:
const compression = require('compression') server.use(compression);
inside the app() function in the server.ts file, the website keeps loading forever without throwing any errors.
app()
server.ts
How do I fix this issue?
compression is a function. You just need to call it:
compression
server.use(compression());
2.1m questions
2.1m answers
60 comments
57.0k users