{"action":"created","comment":{"url":"https://api.github.com/repos/maeltm/vote_widget/pulls/comments/73797709","id":73797709,"diff_hunk":"@@ -1,10 +1,33 @@\n 'use strict';\n \n+var bodyParser = require('body-parser');\n var express = require('express');\n+var ec = require('../core/common/errorCode');\n+\n var app = express();\n \n+app.use(bodyParser.json());\n+app.use(bodyParser.urlencoded({\n+  extended: true\n+}));\n+\n app.use('/v1', require('./route/v1/movies'));\n app.use('/v1', require('./route/v1/users'));\n app.use('/v1', require('./route/v1/votes'));\n \n+app.use(function(req, res, next) {\n+  next(ec.NotFound());\n+});\n+\n+app.use(function(err, req, res, next) {\n+  if (err !== 404 && !/node-superagent/.test(req.headers['user-agent'])) {\n+    console.error('response error with ', { err: err });\n+    console.error(err.stack);\n+  }\n+\n+  res.status(err.status || 500);\n+  res.json({ message: err.message, error: err });\n+  next();","path":"api/app.js","position":30,"original_position":30,"commit_id":"f6f64e5e6573727a2d5938148625bcca021d683a","original_commit_id":"f6f64e5e6573727a2d5938148625bcca021d683a","user":{"login":"maeltm","id":1476099,"avatar_url":"https://avatars.githubusercontent.com/u/1476099?v=3","gravatar_id":"","url":"https://api.github.com/users/maeltm","html_url":"https://github.com/maeltm","followers_url":"https://api.github.com/users/maeltm/followers","following_url":"https://api.github.com/users/maeltm/following{/other_user}","gists_url":"https://api.github.com/users/maeltm/gists{/gist_id}","starred_url":"https://api.github.com/users/maeltm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maeltm/subscriptions","organizations_url":"https://api.github.com/users/maeltm/orgs","repos_url":"https://api.github.com/users/maeltm/repos","events_url":"https://api.github.com/users/maeltm/events{/privacy}","received_events_url":"https://api.github.com/users/maeltm/received_events","type":"User","site_admin":false},"body":"현재 구현된 것 중에는 에러 응답 처리후 수행되는 부분이 없습니다. 예전에 체인이 끊긴 경험이 있어 버릇 처럼 작성한 코드입니다.\r\n만약 추가를 한다면 에러처리 이후 email notification을 보낸다거나 하는 기능이 추가 될 수 있을 것 같습니다.","created_at":"2016-08-07T08:18:01Z","updated_at":"2016-08-07T08:18:01Z","html_url":"https://github.com/maeltm/vote_widget/pull/8#discussion_r73797709","pull_request_url":"https://api.github.com/repos/maeltm/vote_widget/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/maeltm/vote_widget/pulls/comments/73797709"},"html":{"href":"https://github.com/maeltm/vote_widget/pull/8#discussion_r73797709"},"pull_request":{"href":"https://api.github.com/repos/maeltm/vote_widget/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/maeltm/vote_widget/pulls/8","id":80221436,"html_url":"https://github.com/maeltm/vote_widget/pull/8","diff_url":"https://github.com/maeltm/vote_widget/pull/8.diff","patch_url":"https://github.com/maeltm/vote_widget/pull/8.patch","issue_url":"https://api.github.com/repos/maeltm/vote_widget/issues/8","number":8,"state":"open","locked":false,"title":"Implement Api","user":{"login":"maeltm","id":1476099,"avatar_url":"https://avatars.githubusercontent.com/u/1476099?v=3","gravatar_id":"","url":"https://api.github.com/users/maeltm","html_url":"https://github.com/maeltm","followers_url":"https://api.github.com/users/maeltm/followers","following_url":"https://api.github.com/users/maeltm/following{/other_user}","gists_url":"https://api.github.com/users/maeltm/gists{/gist_id}","starred_url":"https://api.github.com/users/maeltm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maeltm/subscriptions","organizations_url":"https://api.github.com/users/maeltm/orgs","repos_url":"https://api.github.com/users/maeltm/repos","events_url":"https://api.github.com/users/maeltm/events{/privacy}","received_events_url":"https://api.github.com/users/maeltm/received_events","type":"User","site_admin":false},"body":"Closes #5 \r\nCloses #6 \r\nCloses #7 \r\n","created_at":"2016-08-05T10:23:31Z","updated_at":"2016-08-07T08:18:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"18c1820c8ced0706195c91bd12a0cb4146d21656","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/maeltm/vote_widget/milestones/2","html_url":"https://github.com/maeltm/vote_widget/milestones/RESTful%20API%20%EB%94%94%EC%9E%90%EC%9D%B8","labels_url":"https://api.github.com/repos/maeltm/vote_widget/milestones/2/labels","id":1919947,"number":2,"title":"RESTful API 디자인","description":"각 API endpoint는 Github API 설명문을 참고하여, Github Issue에 상세한 스펙 (HTTP request, parameters, response 등)을 적고, Pull Request에서 해당 Issue를 링크하여 Pull Request 피드백시에 참고할 수 있도록 해주세요\r\n\r\n - Movies table에 있는 영화 정보를 가져오는 API endpoint 만들기\r\n - Users table에 사용자가 좋아하는 영화를 저장하는 API endpoint 만들기\r\n - 위 endpoint들의 Unit Tests 작성하기\r\n\r\n\r\n","creator":{"login":"maeltm","id":1476099,"avatar_url":"https://avatars.githubusercontent.com/u/1476099?v=3","gravatar_id":"","url":"https://api.github.com/users/maeltm","html_url":"https://github.com/maeltm","followers_url":"https://api.github.com/users/maeltm/followers","following_url":"https://api.github.com/users/maeltm/following{/other_user}","gists_url":"https://api.github.com/users/maeltm/gists{/gist_id}","starred_url":"https://api.github.com/users/maeltm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maeltm/subscriptions","organizations_url":"https://api.github.com/users/maeltm/orgs","repos_url":"https://api.github.com/users/maeltm/repos","events_url":"https://api.github.com/users/maeltm/events{/privacy}","received_events_url":"https://api.github.com/users/maeltm/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":0,"state":"open","created_at":"2016-08-03T05:50:46Z","updated_at":"2016-08-06T06:08:01Z","due_on":"2016-08-06T15:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/maeltm/vote_widget/pulls/8/commits","review_comments_url":"https://api.github.com/repos/maeltm/vote_widget/pulls/8/comments","review_comment_url":"https://api.github.com/repos/maeltm/vote_widget/pulls/comments{/number}","comments_url":"https://api.github.com/repos/maeltm/vote_widget/issues/8/comments","statuses_url":"https://api.github.com/repos/maeltm/vote_widget/statuses/f6f64e5e6573727a2d5938148625bcca021d683a","head":{"label":"maeltm:api","ref":"api","sha":"f6f64e5e6573727a2d5938148625bcca021d683a","user":{"login":"maeltm","id":1476099,"avatar_url":"https://avatars.githubusercontent.com/u/1476099?v=3","gravatar_id":"","url":"https://api.github.com/users/maeltm","html_url":"https://github.com/maeltm","followers_url":"https://api.github.com/users/maeltm/followers","following_url":"https://api.github.com/users/maeltm/following{/other_user}","gists_url":"https://api.github.com/users/maeltm/gists{/gist_id}","starred_url":"https://api.github.com/users/maeltm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maeltm/subscriptions","organizations_url":"https://api.github.com/users/maeltm/orgs","repos_url":"https://api.github.com/users/maeltm/repos","events_url":"https://api.github.com/users/maeltm/events{/privacy}","received_events_url":"https://api.github.com/users/maeltm/received_events","type":"User","site_admin":false},"repo":{"id":64816965,"name":"vote_widget","full_name":"maeltm/vote_widget","owner":{"login":"maeltm","id":1476099,"avatar_url":"https://avatars.githubusercontent.com/u/1476099?v=3","gravatar_id":"","url":"https://api.github.com/users/maeltm","html_url":"https://github.com/maeltm","followers_url":"https://api.github.com/users/maeltm/followers","following_url":"https://api.github.com/users/maeltm/following{/other_user}","gists_url":"https://api.github.com/users/maeltm/gists{/gist_id}","starred_url":"https://api.github.com/users/maeltm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maeltm/subscriptions","organizations_url":"https://api.github.com/users/maeltm/orgs","repos_url":"https://api.github.com/users/maeltm/repos","events_url":"https://api.github.com/users/maeltm/events{/privacy}","received_events_url":"https://api.github.com/users/maeltm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maeltm/vote_widget","description":null,"fork":false,"url":"https://api.github.com/repos/maeltm/vote_widget","forks_url":"https://api.github.com/repos/maeltm/vote_widget/forks","keys_url":"https://api.github.com/repos/maeltm/vote_widget/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maeltm/vote_widget/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maeltm/vote_widget/teams","hooks_url":"https://api.github.com/repos/maeltm/vote_widget/hooks","issue_events_url":"https://api.github.com/repos/maeltm/vote_widget/issues/events{/number}","events_url":"https://api.github.com/repos/maeltm/vote_widget/events","assignees_url":"https://api.github.com/repos/maeltm/vote_widget/assignees{/user}","branches_url":"https://api.github.com/repos/maeltm/vote_widget/branches{/branch}","tags_url":"https://api.github.com/repos/maeltm/vote_widget/tags","blobs_url":"https://api.github.com/repos/maeltm/vote_widget/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maeltm/vote_widget/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maeltm/vote_widget/git/refs{/sha}","trees_url":"https://api.github.com/repos/maeltm/vote_widget/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maeltm/vote_widget/statuses/{sha}","languages_url":"https://api.github.com/repos/maeltm/vote_widget/languages","stargazers_url":"https://api.github.com/repos/maeltm/vote_widget/stargazers","contributors_url":"https://api.github.com/repos/maeltm/vote_widget/contributors","subscribers_url":"https://api.github.com/repos/maeltm/vote_widget/subscribers","subscription_url":"https://api.github.com/repos/maeltm/vote_widget/subscription","commits_url":"https://api.github.com/repos/maeltm/vote_widget/commits{/sha}","git_commits_url":"https://api.github.com/repos/maeltm/vote_widget/git/commits{/sha}","comments_url":"https://api.github.com/repos/maeltm/vote_widget/comments{/number}","issue_comment_url":"https://api.github.com/repos/maeltm/vote_widget/issues/comments{/number}","contents_url":"https://api.github.com/repos/maeltm/vote_widget/contents/{+path}","compare_url":"https://api.github.com/repos/maeltm/vote_widget/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maeltm/vote_widget/merges","archive_url":"https://api.github.com/repos/maeltm/vote_widget/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maeltm/vote_widget/downloads","issues_url":"https://api.github.com/repos/maeltm/vote_widget/issues{/number}","pulls_url":"https://api.github.com/repos/maeltm/vote_widget/pulls{/number}","milestones_url":"https://api.github.com/repos/maeltm/vote_widget/milestones{/number}","notifications_url":"https://api.github.com/repos/maeltm/vote_widget/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maeltm/vote_widget/labels{/name}","releases_url":"https://api.github.com/repos/maeltm/vote_widget/releases{/id}","deployments_url":"https://api.github.com/repos/maeltm/vote_widget/deployments","created_at":"2016-08-03T05:14:23Z","updated_at":"2016-08-04T06:45:17Z","pushed_at":"2016-08-06T06:07:54Z","git_url":"git://github.com/maeltm/vote_widget.git","ssh_url":"git@github.com:maeltm/vote_widget.git","clone_url":"https://github.com/maeltm/vote_widget.git","svn_url":"https://github.com/maeltm/vote_widget","homepage":null,"size":22,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":7,"forks":0,"open_issues":7,"watchers":0,"default_branch":"master"}},"base":{"label":"maeltm:apiInit","ref":"apiInit","sha":"2114d60c77ff973ab7b484651f12eb0e8a434cc5","user":{"login":"maeltm","id":1476099,"avatar_url":"https://avatars.githubusercontent.com/u/1476099?v=3","gravatar_id":"","url":"https://api.github.com/users/maeltm","html_url":"https://github.com/maeltm","followers_url":"https://api.github.com/users/maeltm/followers","following_url":"https://api.github.com/users/maeltm/following{/other_user}","gists_url":"https://api.github.com/users/maeltm/gists{/gist_id}","starred_url":"https://api.github.com/users/maeltm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maeltm/subscriptions","organizations_url":"https://api.github.com/users/maeltm/orgs","repos_url":"https://api.github.com/users/maeltm/repos","events_url":"https://api.github.com/users/maeltm/events{/privacy}","received_events_url":"https://api.github.com/users/maeltm/received_events","type":"User","site_admin":false},"repo":{"id":64816965,"name":"vote_widget","full_name":"maeltm/vote_widget","owner":{"login":"maeltm","id":1476099,"avatar_url":"https://avatars.githubusercontent.com/u/1476099?v=3","gravatar_id":"","url":"https://api.github.com/users/maeltm","html_url":"https://github.com/maeltm","followers_url":"https://api.github.com/users/maeltm/followers","following_url":"https://api.github.com/users/maeltm/following{/other_user}","gists_url":"https://api.github.com/users/maeltm/gists{/gist_id}","starred_url":"https://api.github.com/users/maeltm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maeltm/subscriptions","organizations_url":"https://api.github.com/users/maeltm/orgs","repos_url":"https://api.github.com/users/maeltm/repos","events_url":"https://api.github.com/users/maeltm/events{/privacy}","received_events_url":"https://api.github.com/users/maeltm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maeltm/vote_widget","description":null,"fork":false,"url":"https://api.github.com/repos/maeltm/vote_widget","forks_url":"https://api.github.com/repos/maeltm/vote_widget/forks","keys_url":"https://api.github.com/repos/maeltm/vote_widget/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maeltm/vote_widget/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maeltm/vote_widget/teams","hooks_url":"https://api.github.com/repos/maeltm/vote_widget/hooks","issue_events_url":"https://api.github.com/repos/maeltm/vote_widget/issues/events{/number}","events_url":"https://api.github.com/repos/maeltm/vote_widget/events","assignees_url":"https://api.github.com/repos/maeltm/vote_widget/assignees{/user}","branches_url":"https://api.github.com/repos/maeltm/vote_widget/branches{/branch}","tags_url":"https://api.github.com/repos/maeltm/vote_widget/tags","blobs_url":"https://api.github.com/repos/maeltm/vote_widget/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maeltm/vote_widget/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maeltm/vote_widget/git/refs{/sha}","trees_url":"https://api.github.com/repos/maeltm/vote_widget/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maeltm/vote_widget/statuses/{sha}","languages_url":"https://api.github.com/repos/maeltm/vote_widget/languages","stargazers_url":"https://api.github.com/repos/maeltm/vote_widget/stargazers","contributors_url":"https://api.github.com/repos/maeltm/vote_widget/contributors","subscribers_url":"https://api.github.com/repos/maeltm/vote_widget/subscribers","subscription_url":"https://api.github.com/repos/maeltm/vote_widget/subscription","commits_url":"https://api.github.com/repos/maeltm/vote_widget/commits{/sha}","git_commits_url":"https://api.github.com/repos/maeltm/vote_widget/git/commits{/sha}","comments_url":"https://api.github.com/repos/maeltm/vote_widget/comments{/number}","issue_comment_url":"https://api.github.com/repos/maeltm/vote_widget/issues/comments{/number}","contents_url":"https://api.github.com/repos/maeltm/vote_widget/contents/{+path}","compare_url":"https://api.github.com/repos/maeltm/vote_widget/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maeltm/vote_widget/merges","archive_url":"https://api.github.com/repos/maeltm/vote_widget/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maeltm/vote_widget/downloads","issues_url":"https://api.github.com/repos/maeltm/vote_widget/issues{/number}","pulls_url":"https://api.github.com/repos/maeltm/vote_widget/pulls{/number}","milestones_url":"https://api.github.com/repos/maeltm/vote_widget/milestones{/number}","notifications_url":"https://api.github.com/repos/maeltm/vote_widget/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maeltm/vote_widget/labels{/name}","releases_url":"https://api.github.com/repos/maeltm/vote_widget/releases{/id}","deployments_url":"https://api.github.com/repos/maeltm/vote_widget/deployments","created_at":"2016-08-03T05:14:23Z","updated_at":"2016-08-04T06:45:17Z","pushed_at":"2016-08-06T06:07:54Z","git_url":"git://github.com/maeltm/vote_widget.git","ssh_url":"git@github.com:maeltm/vote_widget.git","clone_url":"https://github.com/maeltm/vote_widget.git","svn_url":"https://github.com/maeltm/vote_widget","homepage":null,"size":22,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":7,"forks":0,"open_issues":7,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/maeltm/vote_widget/pulls/8"},"html":{"href":"https://github.com/maeltm/vote_widget/pull/8"},"issue":{"href":"https://api.github.com/repos/maeltm/vote_widget/issues/8"},"comments":{"href":"https://api.github.com/repos/maeltm/vote_widget/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/maeltm/vote_widget/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/maeltm/vote_widget/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/maeltm/vote_widget/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/maeltm/vote_widget/statuses/f6f64e5e6573727a2d5938148625bcca021d683a"}}}}
{"actor":{"display_login":"maeltm"}}