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) {