{"action":"created","comment":{"url":"https://api.github.com/repos/andela/vvida/pulls/comments/40762664","id":40762664,"diff_hunk":"@@ -0,0 +1,97 @@\n+// events api\n+// this api will handle all the routes for events\n+//\n+\n+var Events = require('../schemas/events');\n+\n+module.exports = function(app, config) {\n+\n+  app.route('/api/events')\n+    .get(function(req, res) {\n+      Events.findAll().then(function(event) {\n+        if (!event) {\n+          res.status(404).send('events not found');\n+        } else {\n+          res.json(event);\n+        }\n+      });\n+    });\n+\n+  app.route('/api/events/:id')\n+    // create event route.\n+    .post(function(req, res) {\n+      Events.sync().then(function() {\n+        return Events.create({\n+          user_id: req.params.id,\n+          ev_name: req.body.eventName,\n+          description: req.body.description,\n+          location: req.body.location,\n+          venue: req.body.venue,\n+          time: req.body.time,\n+          sponsor: req.body.sponsor\n+        }).then(function(event) {\n+          if (!event) {\n+            res.json({\n+              isCreated: false,\n+              message: \"Event was not created\"","path":"server/routes/events.js","position":36,"original_position":36,"commit_id":"f89dbd46e6dabfbf5ea8616fd52b8ee1feaa2e20","original_commit_id":"f89dbd46e6dabfbf5ea8616fd52b8ee1feaa2e20","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Mixed double and single quotes.","created_at":"2015-09-30T06:41:03Z","updated_at":"2015-09-30T06:41:03Z","html_url":"https://github.com/andela/vvida/pull/40#discussion_r40762664","pull_request_url":"https://api.github.com/repos/andela/vvida/pulls/40","_links":{"self":{"href":"https://api.github.com/repos/andela/vvida/pulls/comments/40762664"},"html":{"href":"https://github.com/andela/vvida/pull/40#discussion_r40762664"},"pull_request":{"href":"https://api.github.com/repos/andela/vvida/pulls/40"}}},"pull_request":{"url":"https://api.github.com/repos/andela/vvida/pulls/40","id":46366235,"html_url":"https://github.com/andela/vvida/pull/40","diff_url":"https://github.com/andela/vvida/pull/40.diff","patch_url":"https://github.com/andela/vvida/pull/40.patch","issue_url":"https://api.github.com/repos/andela/vvida/issues/40","number":40,"state":"open","locked":false,"title":"Merge feature/events-items-api into develop","user":{"login":"andela-hkoske","id":13534520,"avatar_url":"https://avatars.githubusercontent.com/u/13534520?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-hkoske","html_url":"https://github.com/andela-hkoske","followers_url":"https://api.github.com/users/andela-hkoske/followers","following_url":"https://api.github.com/users/andela-hkoske/following{/other_user}","gists_url":"https://api.github.com/users/andela-hkoske/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-hkoske/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-hkoske/subscriptions","organizations_url":"https://api.github.com/users/andela-hkoske/orgs","repos_url":"https://api.github.com/users/andela-hkoske/repos","events_url":"https://api.github.com/users/andela-hkoske/events{/privacy}","received_events_url":"https://api.github.com/users/andela-hkoske/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-30T06:40:50Z","updated_at":"2015-09-30T06:41:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e0277332699d83868852960139f18e5e20c827e4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/andela/vvida/pulls/40/commits","review_comments_url":"https://api.github.com/repos/andela/vvida/pulls/40/comments","review_comment_url":"https://api.github.com/repos/andela/vvida/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/vvida/issues/40/comments","statuses_url":"https://api.github.com/repos/andela/vvida/statuses/f89dbd46e6dabfbf5ea8616fd52b8ee1feaa2e20","head":{"label":"andela:feature/events-items-api","ref":"feature/events-items-api","sha":"f89dbd46e6dabfbf5ea8616fd52b8ee1feaa2e20","user":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":41422275,"name":"vvida","full_name":"andela/vvida","owner":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/vvida","description":"","fork":false,"url":"https://api.github.com/repos/andela/vvida","forks_url":"https://api.github.com/repos/andela/vvida/forks","keys_url":"https://api.github.com/repos/andela/vvida/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/vvida/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/vvida/teams","hooks_url":"https://api.github.com/repos/andela/vvida/hooks","issue_events_url":"https://api.github.com/repos/andela/vvida/issues/events{/number}","events_url":"https://api.github.com/repos/andela/vvida/events","assignees_url":"https://api.github.com/repos/andela/vvida/assignees{/user}","branches_url":"https://api.github.com/repos/andela/vvida/branches{/branch}","tags_url":"https://api.github.com/repos/andela/vvida/tags","blobs_url":"https://api.github.com/repos/andela/vvida/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/vvida/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/vvida/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/vvida/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/vvida/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/vvida/languages","stargazers_url":"https://api.github.com/repos/andela/vvida/stargazers","contributors_url":"https://api.github.com/repos/andela/vvida/contributors","subscribers_url":"https://api.github.com/repos/andela/vvida/subscribers","subscription_url":"https://api.github.com/repos/andela/vvida/subscription","commits_url":"https://api.github.com/repos/andela/vvida/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/vvida/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/vvida/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/vvida/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/vvida/contents/{+path}","compare_url":"https://api.github.com/repos/andela/vvida/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/vvida/merges","archive_url":"https://api.github.com/repos/andela/vvida/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/vvida/downloads","issues_url":"https://api.github.com/repos/andela/vvida/issues{/number}","pulls_url":"https://api.github.com/repos/andela/vvida/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/vvida/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/vvida/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/vvida/labels{/name}","releases_url":"https://api.github.com/repos/andela/vvida/releases{/id}","created_at":"2015-08-26T11:36:19Z","updated_at":"2015-09-16T11:59:20Z","pushed_at":"2015-09-30T06:40:50Z","git_url":"git://github.com/andela/vvida.git","ssh_url":"git@github.com:andela/vvida.git","clone_url":"https://github.com/andela/vvida.git","svn_url":"https://github.com/andela/vvida","homepage":null,"size":59553,"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":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"staging"}},"base":{"label":"andela:develop","ref":"develop","sha":"8e2b45223e3c7765c2a9b60f0ca87dc332ab4a95","user":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":41422275,"name":"vvida","full_name":"andela/vvida","owner":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/vvida","description":"","fork":false,"url":"https://api.github.com/repos/andela/vvida","forks_url":"https://api.github.com/repos/andela/vvida/forks","keys_url":"https://api.github.com/repos/andela/vvida/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/vvida/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/vvida/teams","hooks_url":"https://api.github.com/repos/andela/vvida/hooks","issue_events_url":"https://api.github.com/repos/andela/vvida/issues/events{/number}","events_url":"https://api.github.com/repos/andela/vvida/events","assignees_url":"https://api.github.com/repos/andela/vvida/assignees{/user}","branches_url":"https://api.github.com/repos/andela/vvida/branches{/branch}","tags_url":"https://api.github.com/repos/andela/vvida/tags","blobs_url":"https://api.github.com/repos/andela/vvida/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/vvida/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/vvida/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/vvida/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/vvida/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/vvida/languages","stargazers_url":"https://api.github.com/repos/andela/vvida/stargazers","contributors_url":"https://api.github.com/repos/andela/vvida/contributors","subscribers_url":"https://api.github.com/repos/andela/vvida/subscribers","subscription_url":"https://api.github.com/repos/andela/vvida/subscription","commits_url":"https://api.github.com/repos/andela/vvida/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/vvida/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/vvida/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/vvida/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/vvida/contents/{+path}","compare_url":"https://api.github.com/repos/andela/vvida/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/vvida/merges","archive_url":"https://api.github.com/repos/andela/vvida/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/vvida/downloads","issues_url":"https://api.github.com/repos/andela/vvida/issues{/number}","pulls_url":"https://api.github.com/repos/andela/vvida/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/vvida/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/vvida/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/vvida/labels{/name}","releases_url":"https://api.github.com/repos/andela/vvida/releases{/id}","created_at":"2015-08-26T11:36:19Z","updated_at":"2015-09-16T11:59:20Z","pushed_at":"2015-09-30T06:40:50Z","git_url":"git://github.com/andela/vvida.git","ssh_url":"git@github.com:andela/vvida.git","clone_url":"https://github.com/andela/vvida.git","svn_url":"https://github.com/andela/vvida","homepage":null,"size":59553,"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":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/vvida/pulls/40"},"html":{"href":"https://github.com/andela/vvida/pull/40"},"issue":{"href":"https://api.github.com/repos/andela/vvida/issues/40"},"comments":{"href":"https://api.github.com/repos/andela/vvida/issues/40/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/vvida/pulls/40/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/vvida/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/vvida/pulls/40/commits"},"statuses":{"href":"https://api.github.com/repos/andela/vvida/statuses/f89dbd46e6dabfbf5ea8616fd52b8ee1feaa2e20"}}}}