{"action":"created","comment":{"url":"https://api.github.com/repos/npm/annotation-api/pulls/comments/60284769","id":60284769,"diff_hunk":"@@ -11,9 +13,21 @@ module.exports = function (opts, cb) {\n     return next()\n   })\n \n+  server.get('/api/v1/annotations/:pkg', function (req, res, next) {\n+    clientManager.annotationsForPageLoad(req.params.pkg, function (annotations) {\n+      res.send(annotations)\n+      return next()\n+    })\n+  })\n+\n   // start listening on port.\n   server.listen(opts.port, opts.host, function () {\n     cb(null, server)\n     console.info(server.name + ' listening at ' + server.url)\n   })\n+\n+  clientManager.load(function (err) {","path":"index.js","position":27,"original_position":27,"commit_id":"2c96d3fa6d3eabf2746de9398f386d85a398cd39","original_commit_id":"2c96d3fa6d3eabf2746de9398f386d85a398cd39","user":{"login":"nexdrew","id":1929625,"avatar_url":"https://avatars.githubusercontent.com/u/1929625?v=3","gravatar_id":"","url":"https://api.github.com/users/nexdrew","html_url":"https://github.com/nexdrew","followers_url":"https://api.github.com/users/nexdrew/followers","following_url":"https://api.github.com/users/nexdrew/following{/other_user}","gists_url":"https://api.github.com/users/nexdrew/gists{/gist_id}","starred_url":"https://api.github.com/users/nexdrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nexdrew/subscriptions","organizations_url":"https://api.github.com/users/nexdrew/orgs","repos_url":"https://api.github.com/users/nexdrew/repos","events_url":"https://api.github.com/users/nexdrew/events{/privacy}","received_events_url":"https://api.github.com/users/nexdrew/received_events","type":"User","site_admin":false},"body":"@bcoe So we load addons once on startup, and then add new ones dynamically while running?","created_at":"2016-04-19T18:27:13Z","updated_at":"2016-04-19T18:27:13Z","html_url":"https://github.com/npm/annotation-api/pull/4#discussion_r60284769","pull_request_url":"https://api.github.com/repos/npm/annotation-api/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/npm/annotation-api/pulls/comments/60284769"},"html":{"href":"https://github.com/npm/annotation-api/pull/4#discussion_r60284769"},"pull_request":{"href":"https://api.github.com/repos/npm/annotation-api/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/npm/annotation-api/pulls/4","id":67062623,"html_url":"https://github.com/npm/annotation-api/pull/4","diff_url":"https://github.com/npm/annotation-api/pull/4.diff","patch_url":"https://github.com/npm/annotation-api/pull/4.patch","issue_url":"https://api.github.com/repos/npm/annotation-api/issues/4","number":4,"state":"open","locked":false,"title":"feat: add route for fetching annotations","user":{"login":"bcoe","id":194609,"avatar_url":"https://avatars.githubusercontent.com/u/194609?v=3","gravatar_id":"","url":"https://api.github.com/users/bcoe","html_url":"https://github.com/bcoe","followers_url":"https://api.github.com/users/bcoe/followers","following_url":"https://api.github.com/users/bcoe/following{/other_user}","gists_url":"https://api.github.com/users/bcoe/gists{/gist_id}","starred_url":"https://api.github.com/users/bcoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcoe/subscriptions","organizations_url":"https://api.github.com/users/bcoe/orgs","repos_url":"https://api.github.com/users/bcoe/repos","events_url":"https://api.github.com/users/bcoe/events{/privacy}","received_events_url":"https://api.github.com/users/bcoe/received_events","type":"User","site_admin":false},"body":"adds route for grabbing package annotations (`/api/v1/annotations/:pig`), fixed a couple minor nits in the process found while performing end-to-end testing:\r\n\r\n* my \"integration\" was returning a string rather than an Object, I made it so we handle this edge-case.\r\n* we were attempting to use `res` even though it was not defined if a connection could not be negotiated with the OAuth API.","created_at":"2016-04-19T18:02:32Z","updated_at":"2016-04-19T18:27:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e90c6e78fa2e48620ef3b69e7abcbb386c173e48","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/npm/annotation-api/pulls/4/commits","review_comments_url":"https://api.github.com/repos/npm/annotation-api/pulls/4/comments","review_comment_url":"https://api.github.com/repos/npm/annotation-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/npm/annotation-api/issues/4/comments","statuses_url":"https://api.github.com/repos/npm/annotation-api/statuses/2c96d3fa6d3eabf2746de9398f386d85a398cd39","head":{"label":"npm:annotations-route","ref":"annotations-route","sha":"2c96d3fa6d3eabf2746de9398f386d85a398cd39","user":{"login":"npm","id":6078720,"avatar_url":"https://avatars.githubusercontent.com/u/6078720?v=3","gravatar_id":"","url":"https://api.github.com/users/npm","html_url":"https://github.com/npm","followers_url":"https://api.github.com/users/npm/followers","following_url":"https://api.github.com/users/npm/following{/other_user}","gists_url":"https://api.github.com/users/npm/gists{/gist_id}","starred_url":"https://api.github.com/users/npm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npm/subscriptions","organizations_url":"https://api.github.com/users/npm/orgs","repos_url":"https://api.github.com/users/npm/repos","events_url":"https://api.github.com/users/npm/events{/privacy}","received_events_url":"https://api.github.com/users/npm/received_events","type":"Organization","site_admin":false},"repo":{"id":55648438,"name":"annotation-api","full_name":"npm/annotation-api","owner":{"login":"npm","id":6078720,"avatar_url":"https://avatars.githubusercontent.com/u/6078720?v=3","gravatar_id":"","url":"https://api.github.com/users/npm","html_url":"https://github.com/npm","followers_url":"https://api.github.com/users/npm/followers","following_url":"https://api.github.com/users/npm/following{/other_user}","gists_url":"https://api.github.com/users/npm/gists{/gist_id}","starred_url":"https://api.github.com/users/npm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npm/subscriptions","organizations_url":"https://api.github.com/users/npm/orgs","repos_url":"https://api.github.com/users/npm/repos","events_url":"https://api.github.com/users/npm/events{/privacy}","received_events_url":"https://api.github.com/users/npm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/npm/annotation-api","description":"API for polling a set of external integrations and annotating packages and other entities on npmjs.com","fork":false,"url":"https://api.github.com/repos/npm/annotation-api","forks_url":"https://api.github.com/repos/npm/annotation-api/forks","keys_url":"https://api.github.com/repos/npm/annotation-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/npm/annotation-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/npm/annotation-api/teams","hooks_url":"https://api.github.com/repos/npm/annotation-api/hooks","issue_events_url":"https://api.github.com/repos/npm/annotation-api/issues/events{/number}","events_url":"https://api.github.com/repos/npm/annotation-api/events","assignees_url":"https://api.github.com/repos/npm/annotation-api/assignees{/user}","branches_url":"https://api.github.com/repos/npm/annotation-api/branches{/branch}","tags_url":"https://api.github.com/repos/npm/annotation-api/tags","blobs_url":"https://api.github.com/repos/npm/annotation-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/npm/annotation-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/npm/annotation-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/npm/annotation-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/npm/annotation-api/statuses/{sha}","languages_url":"https://api.github.com/repos/npm/annotation-api/languages","stargazers_url":"https://api.github.com/repos/npm/annotation-api/stargazers","contributors_url":"https://api.github.com/repos/npm/annotation-api/contributors","subscribers_url":"https://api.github.com/repos/npm/annotation-api/subscribers","subscription_url":"https://api.github.com/repos/npm/annotation-api/subscription","commits_url":"https://api.github.com/repos/npm/annotation-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/npm/annotation-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/npm/annotation-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/npm/annotation-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/npm/annotation-api/contents/{+path}","compare_url":"https://api.github.com/repos/npm/annotation-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/npm/annotation-api/merges","archive_url":"https://api.github.com/repos/npm/annotation-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/npm/annotation-api/downloads","issues_url":"https://api.github.com/repos/npm/annotation-api/issues{/number}","pulls_url":"https://api.github.com/repos/npm/annotation-api/pulls{/number}","milestones_url":"https://api.github.com/repos/npm/annotation-api/milestones{/number}","notifications_url":"https://api.github.com/repos/npm/annotation-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/npm/annotation-api/labels{/name}","releases_url":"https://api.github.com/repos/npm/annotation-api/releases{/id}","deployments_url":"https://api.github.com/repos/npm/annotation-api/deployments","created_at":"2016-04-06T23:29:35Z","updated_at":"2016-04-11T22:21:17Z","pushed_at":"2016-04-19T18:02:33Z","git_url":"git://github.com/npm/annotation-api.git","ssh_url":"git@github.com:npm/annotation-api.git","clone_url":"https://github.com/npm/annotation-api.git","svn_url":"https://github.com/npm/annotation-api","homepage":null,"size":14,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"npm:master","ref":"master","sha":"02debcf5b8939f35e2c3649e4ced9295757301b3","user":{"login":"npm","id":6078720,"avatar_url":"https://avatars.githubusercontent.com/u/6078720?v=3","gravatar_id":"","url":"https://api.github.com/users/npm","html_url":"https://github.com/npm","followers_url":"https://api.github.com/users/npm/followers","following_url":"https://api.github.com/users/npm/following{/other_user}","gists_url":"https://api.github.com/users/npm/gists{/gist_id}","starred_url":"https://api.github.com/users/npm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npm/subscriptions","organizations_url":"https://api.github.com/users/npm/orgs","repos_url":"https://api.github.com/users/npm/repos","events_url":"https://api.github.com/users/npm/events{/privacy}","received_events_url":"https://api.github.com/users/npm/received_events","type":"Organization","site_admin":false},"repo":{"id":55648438,"name":"annotation-api","full_name":"npm/annotation-api","owner":{"login":"npm","id":6078720,"avatar_url":"https://avatars.githubusercontent.com/u/6078720?v=3","gravatar_id":"","url":"https://api.github.com/users/npm","html_url":"https://github.com/npm","followers_url":"https://api.github.com/users/npm/followers","following_url":"https://api.github.com/users/npm/following{/other_user}","gists_url":"https://api.github.com/users/npm/gists{/gist_id}","starred_url":"https://api.github.com/users/npm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npm/subscriptions","organizations_url":"https://api.github.com/users/npm/orgs","repos_url":"https://api.github.com/users/npm/repos","events_url":"https://api.github.com/users/npm/events{/privacy}","received_events_url":"https://api.github.com/users/npm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/npm/annotation-api","description":"API for polling a set of external integrations and annotating packages and other entities on npmjs.com","fork":false,"url":"https://api.github.com/repos/npm/annotation-api","forks_url":"https://api.github.com/repos/npm/annotation-api/forks","keys_url":"https://api.github.com/repos/npm/annotation-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/npm/annotation-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/npm/annotation-api/teams","hooks_url":"https://api.github.com/repos/npm/annotation-api/hooks","issue_events_url":"https://api.github.com/repos/npm/annotation-api/issues/events{/number}","events_url":"https://api.github.com/repos/npm/annotation-api/events","assignees_url":"https://api.github.com/repos/npm/annotation-api/assignees{/user}","branches_url":"https://api.github.com/repos/npm/annotation-api/branches{/branch}","tags_url":"https://api.github.com/repos/npm/annotation-api/tags","blobs_url":"https://api.github.com/repos/npm/annotation-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/npm/annotation-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/npm/annotation-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/npm/annotation-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/npm/annotation-api/statuses/{sha}","languages_url":"https://api.github.com/repos/npm/annotation-api/languages","stargazers_url":"https://api.github.com/repos/npm/annotation-api/stargazers","contributors_url":"https://api.github.com/repos/npm/annotation-api/contributors","subscribers_url":"https://api.github.com/repos/npm/annotation-api/subscribers","subscription_url":"https://api.github.com/repos/npm/annotation-api/subscription","commits_url":"https://api.github.com/repos/npm/annotation-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/npm/annotation-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/npm/annotation-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/npm/annotation-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/npm/annotation-api/contents/{+path}","compare_url":"https://api.github.com/repos/npm/annotation-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/npm/annotation-api/merges","archive_url":"https://api.github.com/repos/npm/annotation-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/npm/annotation-api/downloads","issues_url":"https://api.github.com/repos/npm/annotation-api/issues{/number}","pulls_url":"https://api.github.com/repos/npm/annotation-api/pulls{/number}","milestones_url":"https://api.github.com/repos/npm/annotation-api/milestones{/number}","notifications_url":"https://api.github.com/repos/npm/annotation-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/npm/annotation-api/labels{/name}","releases_url":"https://api.github.com/repos/npm/annotation-api/releases{/id}","deployments_url":"https://api.github.com/repos/npm/annotation-api/deployments","created_at":"2016-04-06T23:29:35Z","updated_at":"2016-04-11T22:21:17Z","pushed_at":"2016-04-19T18:02:33Z","git_url":"git://github.com/npm/annotation-api.git","ssh_url":"git@github.com:npm/annotation-api.git","clone_url":"https://github.com/npm/annotation-api.git","svn_url":"https://github.com/npm/annotation-api","homepage":null,"size":14,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/npm/annotation-api/pulls/4"},"html":{"href":"https://github.com/npm/annotation-api/pull/4"},"issue":{"href":"https://api.github.com/repos/npm/annotation-api/issues/4"},"comments":{"href":"https://api.github.com/repos/npm/annotation-api/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/npm/annotation-api/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/npm/annotation-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/npm/annotation-api/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/npm/annotation-api/statuses/2c96d3fa6d3eabf2746de9398f386d85a398cd39"}}}}