{"action":"created","comment":{"url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/pulls/comments/36267134","id":36267134,"diff_hunk":"@@ -5,210 +5,48 @@ exports.register = function(server, options, next){\n \n   server.route([\n   \n-    {\n-      //GET all quotes by selecting author\n-      method: 'GET',\n-      path: '/quotes',\n-      handler: function(request, reply){\n-        reply(quotes);\n-          var db = request.server.plugins['hapi-mongodb'].db;\n-\n-          db.collection('quotes').find().toArray({\n-            function(err, quotes){\n-             if (err) {return reply('Internal MongoDB error', err);}\n-            }\n-          })\n-      }\n-    },\n-    //GET one quote, add select author or finding parts of that phrase from input box \n-    {\n-      method: 'GET',\n-      path: \"/quotes/{id}\",\n-      handler:function(request, reply){\n-        var quoteID = encodeURIcomponent(\n-          request.params.id);\n-        var db = request.server.plugin['hapi-mongodb'].db;\n-        var ObjectId = request.server.plugins['hapi-mongodb'].ObjectID;\n-\n-        dbcollection('quotes').findOne({\"_id\": ObjectId(quoteID)}), function(err, quote){\n-        if (err) {return reply('Internal MongoDB error', err);}\n-\n-        reply(quote);\n-        }\n-      }\n-    },\n-   \n-   // POST a quote, would this be necessary?\n-   {\n-     method: 'POST',\n-     path: '/quotes',\n-     config:{\n-       handler:function(request, reply){\n-        Auth.authenticated(request,function(result){\n-          if (result.authenticated) {\n-            var db = request.server.plugins['hapi-mongodb'].db;\n-\n-            var tweet = {\n-              \"message\": request.payload.quote.message,\n-                \"user_id: result.user_id\"\n-            };\n-\n-            db.collection('quotes').insert(quotes, function (err, writeResult){\n-              if (err) {return reply('Internal MongoDB error', err);}\n-\n-              reply(writeResult);\n-            });\n-\n-          }else {\n-            reply(result.message);\n+\n+    //1. GET all quotes GET /quotes\n+    method: 'GET',\n+    path: '/quotes',\n+    handler: function(request, reply){\n+      reply(quotes);","path":"routes/quotes.js","position":65,"original_position":65,"commit_id":"32096c1241f1af8874682fd1107e6ce7e59afc0d","original_commit_id":"32096c1241f1af8874682fd1107e6ce7e59afc0d","user":{"login":"f3r","id":970858,"avatar_url":"https://avatars.githubusercontent.com/u/970858?v=3","gravatar_id":"","url":"https://api.github.com/users/f3r","html_url":"https://github.com/f3r","followers_url":"https://api.github.com/users/f3r/followers","following_url":"https://api.github.com/users/f3r/following{/other_user}","gists_url":"https://api.github.com/users/f3r/gists{/gist_id}","starred_url":"https://api.github.com/users/f3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f3r/subscriptions","organizations_url":"https://api.github.com/users/f3r/orgs","repos_url":"https://api.github.com/users/f3r/repos","events_url":"https://api.github.com/users/f3r/events{/privacy}","received_events_url":"https://api.github.com/users/f3r/received_events","type":"User","site_admin":false},"body":"if you `reply(quotes)`, it doesn't matter what you write after. It will respond `undefined` and return","created_at":"2015-08-05T03:30:04Z","updated_at":"2015-08-05T03:30:04Z","html_url":"https://github.com/WDI-HK-8/whosaidthat/pull/2#discussion_r36267134","pull_request_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/WDI-HK-8/whosaidthat/pulls/comments/36267134"},"html":{"href":"https://github.com/WDI-HK-8/whosaidthat/pull/2#discussion_r36267134"},"pull_request":{"href":"https://api.github.com/repos/WDI-HK-8/whosaidthat/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/pulls/2","id":41638295,"html_url":"https://github.com/WDI-HK-8/whosaidthat/pull/2","diff_url":"https://github.com/WDI-HK-8/whosaidthat/pull/2.diff","patch_url":"https://github.com/WDI-HK-8/whosaidthat/pull/2.patch","issue_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/issues/2","number":2,"state":"open","locked":false,"title":"quotes.js(feat)problem with get request, postman displays 404 error n…","user":{"login":"monogut","id":12729485,"avatar_url":"https://avatars.githubusercontent.com/u/12729485?v=3","gravatar_id":"","url":"https://api.github.com/users/monogut","html_url":"https://github.com/monogut","followers_url":"https://api.github.com/users/monogut/followers","following_url":"https://api.github.com/users/monogut/following{/other_user}","gists_url":"https://api.github.com/users/monogut/gists{/gist_id}","starred_url":"https://api.github.com/users/monogut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monogut/subscriptions","organizations_url":"https://api.github.com/users/monogut/orgs","repos_url":"https://api.github.com/users/monogut/repos","events_url":"https://api.github.com/users/monogut/events{/privacy}","received_events_url":"https://api.github.com/users/monogut/received_events","type":"User","site_admin":false},"body":"…ot found","created_at":"2015-08-05T02:36:06Z","updated_at":"2015-08-05T03:30:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"27cff73c888545e5cc5196d74863b88496530147","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/pulls/2/commits","review_comments_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/pulls/2/comments","review_comment_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/issues/2/comments","statuses_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/statuses/32096c1241f1af8874682fd1107e6ce7e59afc0d","head":{"label":"WDI-HK-8:getmethod","ref":"getmethod","sha":"32096c1241f1af8874682fd1107e6ce7e59afc0d","user":{"login":"WDI-HK-8","id":12110100,"avatar_url":"https://avatars.githubusercontent.com/u/12110100?v=3","gravatar_id":"","url":"https://api.github.com/users/WDI-HK-8","html_url":"https://github.com/WDI-HK-8","followers_url":"https://api.github.com/users/WDI-HK-8/followers","following_url":"https://api.github.com/users/WDI-HK-8/following{/other_user}","gists_url":"https://api.github.com/users/WDI-HK-8/gists{/gist_id}","starred_url":"https://api.github.com/users/WDI-HK-8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WDI-HK-8/subscriptions","organizations_url":"https://api.github.com/users/WDI-HK-8/orgs","repos_url":"https://api.github.com/users/WDI-HK-8/repos","events_url":"https://api.github.com/users/WDI-HK-8/events{/privacy}","received_events_url":"https://api.github.com/users/WDI-HK-8/received_events","type":"Organization","site_admin":false},"repo":{"id":39991967,"name":"whosaidthat","full_name":"WDI-HK-8/whosaidthat","owner":{"login":"WDI-HK-8","id":12110100,"avatar_url":"https://avatars.githubusercontent.com/u/12110100?v=3","gravatar_id":"","url":"https://api.github.com/users/WDI-HK-8","html_url":"https://github.com/WDI-HK-8","followers_url":"https://api.github.com/users/WDI-HK-8/followers","following_url":"https://api.github.com/users/WDI-HK-8/following{/other_user}","gists_url":"https://api.github.com/users/WDI-HK-8/gists{/gist_id}","starred_url":"https://api.github.com/users/WDI-HK-8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WDI-HK-8/subscriptions","organizations_url":"https://api.github.com/users/WDI-HK-8/orgs","repos_url":"https://api.github.com/users/WDI-HK-8/repos","events_url":"https://api.github.com/users/WDI-HK-8/events{/privacy}","received_events_url":"https://api.github.com/users/WDI-HK-8/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WDI-HK-8/whosaidthat","description":"","fork":false,"url":"https://api.github.com/repos/WDI-HK-8/whosaidthat","forks_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/forks","keys_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/teams","hooks_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/hooks","issue_events_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/issues/events{/number}","events_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/events","assignees_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/assignees{/user}","branches_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/branches{/branch}","tags_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/tags","blobs_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/git/refs{/sha}","trees_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/statuses/{sha}","languages_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/languages","stargazers_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/stargazers","contributors_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/contributors","subscribers_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/subscribers","subscription_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/subscription","commits_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/commits{/sha}","git_commits_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/git/commits{/sha}","comments_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/comments{/number}","issue_comment_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/issues/comments{/number}","contents_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/contents/{+path}","compare_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/merges","archive_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/downloads","issues_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/issues{/number}","pulls_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/pulls{/number}","milestones_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/milestones{/number}","notifications_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/labels{/name}","releases_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/releases{/id}","created_at":"2015-07-31T07:10:04Z","updated_at":"2015-08-03T04:51:11Z","pushed_at":"2015-08-05T03:04:13Z","git_url":"git://github.com/WDI-HK-8/whosaidthat.git","ssh_url":"git@github.com:WDI-HK-8/whosaidthat.git","clone_url":"https://github.com/WDI-HK-8/whosaidthat.git","svn_url":"https://github.com/WDI-HK-8/whosaidthat","homepage":null,"size":0,"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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"WDI-HK-8:master","ref":"master","sha":"11fc04ed50e69b9598352c33cfe5ee215dbae7f7","user":{"login":"WDI-HK-8","id":12110100,"avatar_url":"https://avatars.githubusercontent.com/u/12110100?v=3","gravatar_id":"","url":"https://api.github.com/users/WDI-HK-8","html_url":"https://github.com/WDI-HK-8","followers_url":"https://api.github.com/users/WDI-HK-8/followers","following_url":"https://api.github.com/users/WDI-HK-8/following{/other_user}","gists_url":"https://api.github.com/users/WDI-HK-8/gists{/gist_id}","starred_url":"https://api.github.com/users/WDI-HK-8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WDI-HK-8/subscriptions","organizations_url":"https://api.github.com/users/WDI-HK-8/orgs","repos_url":"https://api.github.com/users/WDI-HK-8/repos","events_url":"https://api.github.com/users/WDI-HK-8/events{/privacy}","received_events_url":"https://api.github.com/users/WDI-HK-8/received_events","type":"Organization","site_admin":false},"repo":{"id":39991967,"name":"whosaidthat","full_name":"WDI-HK-8/whosaidthat","owner":{"login":"WDI-HK-8","id":12110100,"avatar_url":"https://avatars.githubusercontent.com/u/12110100?v=3","gravatar_id":"","url":"https://api.github.com/users/WDI-HK-8","html_url":"https://github.com/WDI-HK-8","followers_url":"https://api.github.com/users/WDI-HK-8/followers","following_url":"https://api.github.com/users/WDI-HK-8/following{/other_user}","gists_url":"https://api.github.com/users/WDI-HK-8/gists{/gist_id}","starred_url":"https://api.github.com/users/WDI-HK-8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WDI-HK-8/subscriptions","organizations_url":"https://api.github.com/users/WDI-HK-8/orgs","repos_url":"https://api.github.com/users/WDI-HK-8/repos","events_url":"https://api.github.com/users/WDI-HK-8/events{/privacy}","received_events_url":"https://api.github.com/users/WDI-HK-8/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WDI-HK-8/whosaidthat","description":"","fork":false,"url":"https://api.github.com/repos/WDI-HK-8/whosaidthat","forks_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/forks","keys_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/teams","hooks_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/hooks","issue_events_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/issues/events{/number}","events_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/events","assignees_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/assignees{/user}","branches_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/branches{/branch}","tags_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/tags","blobs_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/git/refs{/sha}","trees_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/statuses/{sha}","languages_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/languages","stargazers_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/stargazers","contributors_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/contributors","subscribers_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/subscribers","subscription_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/subscription","commits_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/commits{/sha}","git_commits_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/git/commits{/sha}","comments_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/comments{/number}","issue_comment_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/issues/comments{/number}","contents_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/contents/{+path}","compare_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/merges","archive_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/downloads","issues_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/issues{/number}","pulls_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/pulls{/number}","milestones_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/milestones{/number}","notifications_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/labels{/name}","releases_url":"https://api.github.com/repos/WDI-HK-8/whosaidthat/releases{/id}","created_at":"2015-07-31T07:10:04Z","updated_at":"2015-08-03T04:51:11Z","pushed_at":"2015-08-05T03:04:13Z","git_url":"git://github.com/WDI-HK-8/whosaidthat.git","ssh_url":"git@github.com:WDI-HK-8/whosaidthat.git","clone_url":"https://github.com/WDI-HK-8/whosaidthat.git","svn_url":"https://github.com/WDI-HK-8/whosaidthat","homepage":null,"size":0,"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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WDI-HK-8/whosaidthat/pulls/2"},"html":{"href":"https://github.com/WDI-HK-8/whosaidthat/pull/2"},"issue":{"href":"https://api.github.com/repos/WDI-HK-8/whosaidthat/issues/2"},"comments":{"href":"https://api.github.com/repos/WDI-HK-8/whosaidthat/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/WDI-HK-8/whosaidthat/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/WDI-HK-8/whosaidthat/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WDI-HK-8/whosaidthat/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/WDI-HK-8/whosaidthat/statuses/32096c1241f1af8874682fd1107e6ce7e59afc0d"}}}}