From 84532357105ce5654a78dea384675f43949a5d25 Mon Sep 17 00:00:00 2001 From: Sbrjt Date: Thu, 19 Jun 2025 21:58:18 +0530 Subject: [PATCH] docs: add per-route usage example --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index df1bd789..5384ba42 100644 --- a/README.md +++ b/README.md @@ -219,6 +219,16 @@ app.use(compression()) // add all routes ``` +Per-route usage: + +```js +var router = express.Router() + +router.get('/your-route', compression(), function (req, res) { + res.json({ message: 'This response is compressed' }) +}) +``` + ### Node.js HTTP server ```js