{"action":"opened","issue":{"url":"https://api.github.com/repos/upyun/ruo/issues/3","repository_url":"https://api.github.com/repos/upyun/ruo","labels_url":"https://api.github.com/repos/upyun/ruo/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/upyun/ruo/issues/3/comments","events_url":"https://api.github.com/repos/upyun/ruo/issues/3/events","html_url":"https://github.com/upyun/ruo/issues/3","id":186738405,"number":3,"title":"借鉴 sailsjs 或 thinkjs 优化路由定义","user":{"login":"CatTail","id":1606069,"avatar_url":"https://avatars.githubusercontent.com/u/1606069?v=3","gravatar_id":"","url":"https://api.github.com/users/CatTail","html_url":"https://github.com/CatTail","followers_url":"https://api.github.com/users/CatTail/followers","following_url":"https://api.github.com/users/CatTail/following{/other_user}","gists_url":"https://api.github.com/users/CatTail/gists{/gist_id}","starred_url":"https://api.github.com/users/CatTail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CatTail/subscriptions","organizations_url":"https://api.github.com/users/CatTail/orgs","repos_url":"https://api.github.com/users/CatTail/repos","events_url":"https://api.github.com/users/CatTail/events{/privacy}","received_events_url":"https://api.github.com/users/CatTail/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-02T08:27:14Z","updated_at":"2016-11-02T08:27:14Z","closed_at":null,"body":"目前路由定义有两种方式\r\n\r\n* 基于文件路径对路由进行映射\r\n* 完全自主的路由定义\r\n\r\n而诸如 sailsjs 框架采用了这样的方式\r\n\r\n路由（controller）定义 `AccountController.js`\r\n\r\n```js\r\nmodule.exports = {\r\n  hi: function (req, res) {\r\n    return res.send('Hi there!');\r\n  },\r\n  bye: function (req, res) {\r\n    return res.redirect('http://www.sayonara.com');\r\n  }\r\n};\r\n```\r\n\r\n对应接口\r\n\r\n```\r\n/account/hi\r\n/account/bye\r\n```"}}
{"actor":{"display_login":"CatTail"}}