{"action":"created","issue":{"url":"https://api.github.com/repos/expressjs/express/issues/3098","repository_url":"https://api.github.com/repos/expressjs/express","labels_url":"https://api.github.com/repos/expressjs/express/issues/3098/labels{/name}","comments_url":"https://api.github.com/repos/expressjs/express/issues/3098/comments","events_url":"https://api.github.com/repos/expressjs/express/issues/3098/events","html_url":"https://github.com/expressjs/express/issues/3098","id":182436636,"number":3098,"title":"Used app / router does not exec `params` middleware without call from within app / router","user":{"login":"reggi","id":296798,"avatar_url":"https://avatars.githubusercontent.com/u/296798?v=3","gravatar_id":"","url":"https://api.github.com/users/reggi","html_url":"https://github.com/reggi","followers_url":"https://api.github.com/users/reggi/followers","following_url":"https://api.github.com/users/reggi/following{/other_user}","gists_url":"https://api.github.com/users/reggi/gists{/gist_id}","starred_url":"https://api.github.com/users/reggi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reggi/subscriptions","organizations_url":"https://api.github.com/users/reggi/orgs","repos_url":"https://api.github.com/users/reggi/repos","events_url":"https://api.github.com/users/reggi/events{/privacy}","received_events_url":"https://api.github.com/users/reggi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/expressjs/express/labels/4.x","name":"4.x","color":"ededed"},{"url":"https://api.github.com/repos/expressjs/express/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":{"login":"dougwilson","id":67512,"avatar_url":"https://avatars.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false},"assignees":[{"login":"dougwilson","id":67512,"avatar_url":"https://avatars.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-10-12T05:11:05Z","updated_at":"2016-10-12T05:18:04Z","closed_at":null,"body":"I was just creating a router with only a param in it and found out the hard way that it doesn't execute in the `app` it's `app.use` in.\r\n\r\nHere's the code:\r\n\r\n```js\r\nfunction myRouter () {\r\n  const router = Router({mergeParams: true})\r\n  router.param('appId', async (req, res, next, appId) => {\r\n    console.log('hi')\r\n    return next()\r\n  })\r\n  router.all('/:appId/*', (req, res, next) => {\r\n    return next()\r\n  })\r\n  return router\r\n}\r\n```\r\n\r\nThis will not log `hi` without.\r\n\r\n```js\r\n  router.all('/:appId/*', (req, res, next) => {\r\n    return next()\r\n  })\r\n```\r\n\r\nWhich seems a bit unintuitive."},"comment":{"url":"https://api.github.com/repos/expressjs/express/issues/comments/253121416","html_url":"https://github.com/expressjs/express/issues/3098#issuecomment-253121416","issue_url":"https://api.github.com/repos/expressjs/express/issues/3098","id":253121416,"user":{"login":"dougwilson","id":67512,"avatar_url":"https://avatars.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false},"created_at":"2016-10-12T05:18:04Z","updated_at":"2016-10-12T05:18:04Z","body":"Right, the `router.param`s are confined to the router they were declared in. This is one of the purposes for creating new routers rather than reusing existing routers: because you want to create your own parameters. This allows for each router to have it's own parameter scope and allows for composability by not having routers interfere with each other."}}
{"actor":{"display_login":"dougwilson"}}