{"action":"created","issue":{"url":"https://api.github.com/repos/fastify/fastify/issues/1228","repository_url":"https://api.github.com/repos/fastify/fastify","labels_url":"https://api.github.com/repos/fastify/fastify/issues/1228/labels{/name}","comments_url":"https://api.github.com/repos/fastify/fastify/issues/1228/comments","events_url":"https://api.github.com/repos/fastify/fastify/issues/1228/events","html_url":"https://github.com/fastify/fastify/pull/1228","id":373183736,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1MTczNzIy","number":1228,"title":"Plugin double prefix","user":{"login":"mcollina","id":52195,"node_id":"MDQ6VXNlcjUyMTk1","avatar_url":"https://avatars0.githubusercontent.com/u/52195?v=4","gravatar_id":"","url":"https://api.github.com/users/mcollina","html_url":"https://github.com/mcollina","followers_url":"https://api.github.com/users/mcollina/followers","following_url":"https://api.github.com/users/mcollina/following{/other_user}","gists_url":"https://api.github.com/users/mcollina/gists{/gist_id}","starred_url":"https://api.github.com/users/mcollina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcollina/subscriptions","organizations_url":"https://api.github.com/users/mcollina/orgs","repos_url":"https://api.github.com/users/mcollina/repos","events_url":"https://api.github.com/users/mcollina/events{/privacy}","received_events_url":"https://api.github.com/users/mcollina/received_events","type":"User","site_admin":false},"labels":[{"id":764678145,"node_id":"MDU6TGFiZWw3NjQ2NzgxNDU=","url":"https://api.github.com/repos/fastify/fastify/labels/semver-major","name":"semver-major","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/fastify/fastify/milestones/2","html_url":"https://github.com/fastify/fastify/milestone/2","labels_url":"https://api.github.com/repos/fastify/fastify/milestones/2/labels","id":3418492,"node_id":"MDk6TWlsZXN0b25lMzQxODQ5Mg==","number":2,"title":"v2.0.0","description":"The next major release of Fastify.","creator":{"login":"delvedor","id":4865608,"node_id":"MDQ6VXNlcjQ4NjU2MDg=","avatar_url":"https://avatars0.githubusercontent.com/u/4865608?v=4","gravatar_id":"","url":"https://api.github.com/users/delvedor","html_url":"https://github.com/delvedor","followers_url":"https://api.github.com/users/delvedor/followers","following_url":"https://api.github.com/users/delvedor/following{/other_user}","gists_url":"https://api.github.com/users/delvedor/gists{/gist_id}","starred_url":"https://api.github.com/users/delvedor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/delvedor/subscriptions","organizations_url":"https://api.github.com/users/delvedor/orgs","repos_url":"https://api.github.com/users/delvedor/repos","events_url":"https://api.github.com/users/delvedor/events{/privacy}","received_events_url":"https://api.github.com/users/delvedor/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":20,"state":"open","created_at":"2018-06-12T10:03:52Z","updated_at":"2018-10-23T20:39:02Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2018-10-23T20:20:20Z","updated_at":"2018-10-24T10:14:40Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/fastify/fastify/pulls/1228","html_url":"https://github.com/fastify/fastify/pull/1228","diff_url":"https://github.com/fastify/fastify/pull/1228.diff","patch_url":"https://github.com/fastify/fastify/pull/1228.patch"},"body":"This is an alternative to #1225 that creates much less breakage. Basically I'm registering two routes, one with and one without the ending slash. I'm up for adding a flag that have the more strict behavior that #1225 defines, if you think it's needed.\r\n\r\n```js\r\n'use strict'\r\n\r\nconst fastify = require('fastify')()\r\n\r\nfastify.register(function (instance, options, next) {\r\n  // the route will be called for both '/english/' and '/english'\r\n  instance.get('/', (req, reply) => {\r\n    reply.send({ greet: 'hello' })\r\n  })\r\n  next()\r\n}, { prefix: '/english' })\r\n\r\nfastify.register(function (instance, options, next) {\r\n  // the handler will be called for both '/italian/' and '/italian'\r\n  instance.get('/', (req, reply) => {\r\n    reply.send({ greet: 'ciao' })\r\n  })\r\n  next()\r\n}, { prefix: '/italian' })\r\n\r\nfastify.listen(8000, function (err) {\r\n  if (err) {\r\n    throw err\r\n  }\r\n  console.log(`server listening on ${fastify.server.address().port}`)\r\n})\r\n```\r\n\r\n#### Checklist\r\n\r\n- [x] run `npm run test` and `npm run benchmark`\r\n- [x] tests and/or benchmarks are included\r\n- [ ] documentation is changed or added\r\n- [x] commit message and code follows [Code of conduct](https://github.com/fastify/fastify/blob/master/CODE_OF_CONDUCT.md)\r\n"},"comment":{"url":"https://api.github.com/repos/fastify/fastify/issues/comments/432598844","html_url":"https://github.com/fastify/fastify/pull/1228#issuecomment-432598844","issue_url":"https://api.github.com/repos/fastify/fastify/issues/1228","id":432598844,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjU5ODg0NA==","user":{"login":"delvedor","id":4865608,"node_id":"MDQ6VXNlcjQ4NjU2MDg=","avatar_url":"https://avatars0.githubusercontent.com/u/4865608?v=4","gravatar_id":"","url":"https://api.github.com/users/delvedor","html_url":"https://github.com/delvedor","followers_url":"https://api.github.com/users/delvedor/followers","following_url":"https://api.github.com/users/delvedor/following{/other_user}","gists_url":"https://api.github.com/users/delvedor/gists{/gist_id}","starred_url":"https://api.github.com/users/delvedor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/delvedor/subscriptions","organizations_url":"https://api.github.com/users/delvedor/orgs","repos_url":"https://api.github.com/users/delvedor/repos","events_url":"https://api.github.com/users/delvedor/events{/privacy}","received_events_url":"https://api.github.com/users/delvedor/received_events","type":"User","site_admin":false},"created_at":"2018-10-24T10:14:40Z","updated_at":"2018-10-24T10:14:40Z","author_association":"MEMBER","body":"It should definitely be documented. What about [here](https://github.com/fastify/fastify/blob/master/docs/Routes.md#route-prefixing)?"}}
{"actor":{"display_login":"delvedor"}}