{"action":"opened","issue":{"url":"https://api.github.com/repos/koajs/trie-router/issues/34","repository_url":"https://api.github.com/repos/koajs/trie-router","labels_url":"https://api.github.com/repos/koajs/trie-router/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/koajs/trie-router/issues/34/comments","events_url":"https://api.github.com/repos/koajs/trie-router/issues/34/events","html_url":"https://github.com/koajs/trie-router/issues/34","id":208726848,"number":34,"title":"Do you have any plans for supporting koa@2 and make API more convenient?","user":{"login":"nervgh","id":2478262,"avatar_url":"https://avatars.githubusercontent.com/u/2478262?v=3","gravatar_id":"","url":"https://api.github.com/users/nervgh","html_url":"https://github.com/nervgh","followers_url":"https://api.github.com/users/nervgh/followers","following_url":"https://api.github.com/users/nervgh/following{/other_user}","gists_url":"https://api.github.com/users/nervgh/gists{/gist_id}","starred_url":"https://api.github.com/users/nervgh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nervgh/subscriptions","organizations_url":"https://api.github.com/users/nervgh/orgs","repos_url":"https://api.github.com/users/nervgh/repos","events_url":"https://api.github.com/users/nervgh/events{/privacy}","received_events_url":"https://api.github.com/users/nervgh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-02-19T16:13:06Z","updated_at":"2017-02-19T16:13:06Z","closed_at":null,"body":"Hi.\r\n\r\nTrie-router is the official router and I think we could give second breath to it.\r\n\r\n## Proposal \\ my vision\r\n\r\n### Requirements\r\n1. It should works with node 7.x.x and higher\r\n2. It should support only koa@2 and higher\r\n3. It should be composable\r\n4. It should have more intuitive\\simple API (to satisfy \"easy to use\" principle)\r\n5. It should be powerful as it is now\r\n\r\n### API\r\n+ Instantiation should requires `new` operator (like Koa@2)\r\n    ```js\r\n    let router = new Router();\r\n    ```\r\n+ Routers could be define like\r\n    ```js\r\n    router[all|get|post|put|del|patch]([path], [...middleware]);\r\n    ```\r\n    + where **path** & **middleware** both optional but it requires at least one of them\r\n    + **path** is `{String|{Array<String>}`\r\n    + **middleware** is `{Function|AsyncFunction|Array<[Function|AsyncFunction]>}`\r\n\r\n+ Router should implements `router.middleware()` like `koa.middleware()` for mounting (composing)\r\n+ `ctx.params` like https://github.com/koajs/trie-router#thisparams\r\n+ https://github.com/koajs/trie-router#features\r\n\r\nWhat do you think about it?"}}
{"actor":{"display_login":"nervgh"}}