The title is self-explanatory, here's the truncated code:
const compress = require("compression");
const api: Express = express();
function shouldCompress(req: Request, res: Response) {
if (req.headers['x-no-compression']) return false;
return compress.filter(req, res);
};
api.use(express.json());
api.use(compress({ threshold: 0, filter: shouldCompress }));
api.get(["*", "/status"], apiGet);
api.post("/update", apiPost);
api.listen(port, () => console.log(`⚡️[server]: API Server is running at http://localhost:${port}`));