From 42daa7d7ffe4f8af9abbb2cc40178a854cd180b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20Unneb=C3=A4ck?= Date: Sun, 6 Nov 2016 12:40:06 +0100 Subject: [PATCH] Fix comparison --- en/guide/using-middleware.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/en/guide/using-middleware.md b/en/guide/using-middleware.md index 3fb27bc9f0..c575277db1 100644 --- a/en/guide/using-middleware.md +++ b/en/guide/using-middleware.md @@ -104,7 +104,7 @@ This example shows a middleware sub-stack that handles GET requests to the `/use ```js app.get('/user/:id', function (req, res, next) { // if the user ID is 0, skip to the next route - if (req.params.id === 0) next('route') + if (req.params.id === '0') next('route') // otherwise pass the control to the next middleware function in this stack else next() }, function (req, res, next) { @@ -151,7 +151,7 @@ router.use('/user/:id', function (req, res, next) { // a middleware sub-stack that handles GET requests to the /user/:id path router.get('/user/:id', function (req, res, next) { // if the user ID is 0, skip to the next router - if (req.params.id === 0) next('route') + if (req.params.id === '0') next('route') // otherwise pass control to the next middleware function in this stack else next() }, function (req, res, next) {