{"action":"created","comment":{"url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/pulls/comments/231188966","pull_request_review_id":172102824,"id":231188966,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMTE4ODk2Ng==","diff_hunk":"@@ -1,5 +1,38 @@\n // import your node modules\n-\n+const express = require(\"express\");\n const db = require('./data/db.js');\n \n // add your server code starting here\n+const server = express();\n+\n+server.get(\"/api/posts\", (req, res) => {\n+    db.find()\n+        .then(posts => {\n+            res.status(200).json(posts);\n+        })\n+        .catch(err => {\n+            res\n+                .status(500)\n+                .json({ error: \"The posts information could not be retrieved.\" },\n+                console.log(err))\n+        })\n+})\n+\n+server.get('/api/posts/:id', (req, res) => {\n+    const { id } = req.params;\n+\n+    db.findById(id)\n+        .then(posts => {\n+            if (posts[0] === undefined){\n+                res.status(404).json({ message: \"The post with the specified ID does not exist.\" })\n+            }\n+            else {","path":"index.js","position":30,"original_position":30,"commit_id":"bf6f1f87eb29c24e6749e083fbb32a6d15a8b29e","original_commit_id":"bf6f1f87eb29c24e6749e083fbb32a6d15a8b29e","user":{"login":"CookieMonsta89","id":20689379,"node_id":"MDQ6VXNlcjIwNjg5Mzc5","avatar_url":"https://avatars3.githubusercontent.com/u/20689379?v=4","gravatar_id":"","url":"https://api.github.com/users/CookieMonsta89","html_url":"https://github.com/CookieMonsta89","followers_url":"https://api.github.com/users/CookieMonsta89/followers","following_url":"https://api.github.com/users/CookieMonsta89/following{/other_user}","gists_url":"https://api.github.com/users/CookieMonsta89/gists{/gist_id}","starred_url":"https://api.github.com/users/CookieMonsta89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CookieMonsta89/subscriptions","organizations_url":"https://api.github.com/users/CookieMonsta89/orgs","repos_url":"https://api.github.com/users/CookieMonsta89/repos","events_url":"https://api.github.com/users/CookieMonsta89/events{/privacy}","received_events_url":"https://api.github.com/users/CookieMonsta89/received_events","type":"User","site_admin":false},"body":"Great use of an if/else statement here.  Good job","created_at":"2018-11-06T16:16:58Z","updated_at":"2018-11-06T16:16:58Z","html_url":"https://github.com/LambdaSchool/Node-Express-Lab/pull/432#discussion_r231188966","pull_request_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/pulls/432","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/pulls/comments/231188966"},"html":{"href":"https://github.com/LambdaSchool/Node-Express-Lab/pull/432#discussion_r231188966"},"pull_request":{"href":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/pulls/432"}}},"pull_request":{"url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/pulls/432","id":228480612,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4NDgwNjEy","html_url":"https://github.com/LambdaSchool/Node-Express-Lab/pull/432","diff_url":"https://github.com/LambdaSchool/Node-Express-Lab/pull/432.diff","patch_url":"https://github.com/LambdaSchool/Node-Express-Lab/pull/432.patch","issue_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/issues/432","number":432,"state":"open","locked":false,"title":"Andre Myrick - Node Express Lab","user":{"login":"AM-Myrick","id":32982005,"node_id":"MDQ6VXNlcjMyOTgyMDA1","avatar_url":"https://avatars2.githubusercontent.com/u/32982005?v=4","gravatar_id":"","url":"https://api.github.com/users/AM-Myrick","html_url":"https://github.com/AM-Myrick","followers_url":"https://api.github.com/users/AM-Myrick/followers","following_url":"https://api.github.com/users/AM-Myrick/following{/other_user}","gists_url":"https://api.github.com/users/AM-Myrick/gists{/gist_id}","starred_url":"https://api.github.com/users/AM-Myrick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AM-Myrick/subscriptions","organizations_url":"https://api.github.com/users/AM-Myrick/orgs","repos_url":"https://api.github.com/users/AM-Myrick/repos","events_url":"https://api.github.com/users/AM-Myrick/events{/privacy}","received_events_url":"https://api.github.com/users/AM-Myrick/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-05T20:27:06Z","updated_at":"2018-11-06T16:16:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c0031977b36795b21def598d64421215327ea710","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/pulls/432/commits","review_comments_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/pulls/432/comments","review_comment_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/pulls/comments{/number}","comments_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/issues/432/comments","statuses_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/statuses/bf6f1f87eb29c24e6749e083fbb32a6d15a8b29e","head":{"label":"AM-Myrick:master","ref":"master","sha":"bf6f1f87eb29c24e6749e083fbb32a6d15a8b29e","user":{"login":"AM-Myrick","id":32982005,"node_id":"MDQ6VXNlcjMyOTgyMDA1","avatar_url":"https://avatars2.githubusercontent.com/u/32982005?v=4","gravatar_id":"","url":"https://api.github.com/users/AM-Myrick","html_url":"https://github.com/AM-Myrick","followers_url":"https://api.github.com/users/AM-Myrick/followers","following_url":"https://api.github.com/users/AM-Myrick/following{/other_user}","gists_url":"https://api.github.com/users/AM-Myrick/gists{/gist_id}","starred_url":"https://api.github.com/users/AM-Myrick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AM-Myrick/subscriptions","organizations_url":"https://api.github.com/users/AM-Myrick/orgs","repos_url":"https://api.github.com/users/AM-Myrick/repos","events_url":"https://api.github.com/users/AM-Myrick/events{/privacy}","received_events_url":"https://api.github.com/users/AM-Myrick/received_events","type":"User","site_admin":false},"repo":{"id":156270162,"node_id":"MDEwOlJlcG9zaXRvcnkxNTYyNzAxNjI=","name":"Node-Express-Lab","full_name":"AM-Myrick/Node-Express-Lab","private":false,"owner":{"login":"AM-Myrick","id":32982005,"node_id":"MDQ6VXNlcjMyOTgyMDA1","avatar_url":"https://avatars2.githubusercontent.com/u/32982005?v=4","gravatar_id":"","url":"https://api.github.com/users/AM-Myrick","html_url":"https://github.com/AM-Myrick","followers_url":"https://api.github.com/users/AM-Myrick/followers","following_url":"https://api.github.com/users/AM-Myrick/following{/other_user}","gists_url":"https://api.github.com/users/AM-Myrick/gists{/gist_id}","starred_url":"https://api.github.com/users/AM-Myrick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AM-Myrick/subscriptions","organizations_url":"https://api.github.com/users/AM-Myrick/orgs","repos_url":"https://api.github.com/users/AM-Myrick/repos","events_url":"https://api.github.com/users/AM-Myrick/events{/privacy}","received_events_url":"https://api.github.com/users/AM-Myrick/received_events","type":"User","site_admin":false},"html_url":"https://github.com/AM-Myrick/Node-Express-Lab","description":"Create, read, update, and delete posts with server-side JavaScript","fork":true,"url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab","forks_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/forks","keys_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/teams","hooks_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/hooks","issue_events_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/issues/events{/number}","events_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/events","assignees_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/assignees{/user}","branches_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/branches{/branch}","tags_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/tags","blobs_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/git/refs{/sha}","trees_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/statuses/{sha}","languages_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/languages","stargazers_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/stargazers","contributors_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/contributors","subscribers_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/subscribers","subscription_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/subscription","commits_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/commits{/sha}","git_commits_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/git/commits{/sha}","comments_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/comments{/number}","issue_comment_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/issues/comments{/number}","contents_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/contents/{+path}","compare_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/merges","archive_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/downloads","issues_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/issues{/number}","pulls_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/pulls{/number}","milestones_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/milestones{/number}","notifications_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/labels{/name}","releases_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/releases{/id}","deployments_url":"https://api.github.com/repos/AM-Myrick/Node-Express-Lab/deployments","created_at":"2018-11-05T19:20:15Z","updated_at":"2018-11-05T20:26:29Z","pushed_at":"2018-11-05T20:26:27Z","git_url":"git://github.com/AM-Myrick/Node-Express-Lab.git","ssh_url":"git@github.com:AM-Myrick/Node-Express-Lab.git","clone_url":"https://github.com/AM-Myrick/Node-Express-Lab.git","svn_url":"https://github.com/AM-Myrick/Node-Express-Lab","homepage":null,"size":55,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"LambdaSchool:master","ref":"master","sha":"d9615d6e0e85f32f35d69e941ddb5bce285c880d","user":{"login":"LambdaSchool","id":24780114,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0NzgwMTE0","avatar_url":"https://avatars1.githubusercontent.com/u/24780114?v=4","gravatar_id":"","url":"https://api.github.com/users/LambdaSchool","html_url":"https://github.com/LambdaSchool","followers_url":"https://api.github.com/users/LambdaSchool/followers","following_url":"https://api.github.com/users/LambdaSchool/following{/other_user}","gists_url":"https://api.github.com/users/LambdaSchool/gists{/gist_id}","starred_url":"https://api.github.com/users/LambdaSchool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LambdaSchool/subscriptions","organizations_url":"https://api.github.com/users/LambdaSchool/orgs","repos_url":"https://api.github.com/users/LambdaSchool/repos","events_url":"https://api.github.com/users/LambdaSchool/events{/privacy}","received_events_url":"https://api.github.com/users/LambdaSchool/received_events","type":"Organization","site_admin":false},"repo":{"id":99846119,"node_id":"MDEwOlJlcG9zaXRvcnk5OTg0NjExOQ==","name":"Node-Express-Lab","full_name":"LambdaSchool/Node-Express-Lab","private":false,"owner":{"login":"LambdaSchool","id":24780114,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0NzgwMTE0","avatar_url":"https://avatars1.githubusercontent.com/u/24780114?v=4","gravatar_id":"","url":"https://api.github.com/users/LambdaSchool","html_url":"https://github.com/LambdaSchool","followers_url":"https://api.github.com/users/LambdaSchool/followers","following_url":"https://api.github.com/users/LambdaSchool/following{/other_user}","gists_url":"https://api.github.com/users/LambdaSchool/gists{/gist_id}","starred_url":"https://api.github.com/users/LambdaSchool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LambdaSchool/subscriptions","organizations_url":"https://api.github.com/users/LambdaSchool/orgs","repos_url":"https://api.github.com/users/LambdaSchool/repos","events_url":"https://api.github.com/users/LambdaSchool/events{/privacy}","received_events_url":"https://api.github.com/users/LambdaSchool/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/LambdaSchool/Node-Express-Lab","description":"Create, read, update, and delete posts with server-side JavaScript","fork":false,"url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab","forks_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/forks","keys_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/teams","hooks_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/hooks","issue_events_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/issues/events{/number}","events_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/events","assignees_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/assignees{/user}","branches_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/branches{/branch}","tags_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/tags","blobs_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/git/refs{/sha}","trees_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/statuses/{sha}","languages_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/languages","stargazers_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/stargazers","contributors_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/contributors","subscribers_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/subscribers","subscription_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/subscription","commits_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/commits{/sha}","git_commits_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/git/commits{/sha}","comments_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/comments{/number}","issue_comment_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/issues/comments{/number}","contents_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/contents/{+path}","compare_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/merges","archive_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/downloads","issues_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/issues{/number}","pulls_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/pulls{/number}","milestones_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/milestones{/number}","notifications_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/labels{/name}","releases_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/releases{/id}","deployments_url":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/deployments","created_at":"2017-08-09T19:36:15Z","updated_at":"2018-11-06T06:57:42Z","pushed_at":"2018-11-06T16:09:13Z","git_url":"git://github.com/LambdaSchool/Node-Express-Lab.git","ssh_url":"git@github.com:LambdaSchool/Node-Express-Lab.git","clone_url":"https://github.com/LambdaSchool/Node-Express-Lab.git","svn_url":"https://github.com/LambdaSchool/Node-Express-Lab","homepage":null,"size":50,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":560,"mirror_url":null,"archived":false,"open_issues_count":397,"license":null,"forks":560,"open_issues":397,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/pulls/432"},"html":{"href":"https://github.com/LambdaSchool/Node-Express-Lab/pull/432"},"issue":{"href":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/issues/432"},"comments":{"href":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/issues/432/comments"},"review_comments":{"href":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/pulls/432/comments"},"review_comment":{"href":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/pulls/432/commits"},"statuses":{"href":"https://api.github.com/repos/LambdaSchool/Node-Express-Lab/statuses/bf6f1f87eb29c24e6749e083fbb32a6d15a8b29e"}},"author_association":"NONE"}}
{"actor":{"display_login":"CookieMonsta89"}}