{"action":"created","comment":{"url":"https://api.github.com/repos/ScottyLabs/tartanhacks/pulls/comments/48679787","id":48679787,"diff_hunk":"@@ -0,0 +1,93 @@\n+/* @file announcements.js\n+ * @brief Defines the handlers for the announcement API endpoints.\n+ *\n+ * @author Oscar Bezi (bezi@scottylabs)\n+ */\n+'use strict';\n+\n+var db;\n+\n+//==============================================================================\n+// Express handlers\n+//==============================================================================\n+var handlers = {};\n+\n+//==============================================================================\n+// GET/POST/DELETE /announcements\n+//==============================================================================\n+\n+/* @brief Return every announcement. */\n+handlers.get = function (req, res) {\n+  var query = 'SELECT * FROM announcements';\n+  db.query(query, [])\n+  .then((rows) => {\n+    var data = {};\n+    rows = rows.map((row) => {\n+      row.id = row.announcement_id;\n+      delete row.announcement_id;","path":"core/routes/announcements.js","position":27,"original_position":27,"commit_id":"b97378f0e9e36b37b6621ccab459eaf3a613013a","original_commit_id":"b97378f0e9e36b37b6621ccab459eaf3a613013a","user":{"login":"jez","id":5544532,"avatar_url":"https://avatars.githubusercontent.com/u/5544532?v=3","gravatar_id":"","url":"https://api.github.com/users/jez","html_url":"https://github.com/jez","followers_url":"https://api.github.com/users/jez/followers","following_url":"https://api.github.com/users/jez/following{/other_user}","gists_url":"https://api.github.com/users/jez/gists{/gist_id}","starred_url":"https://api.github.com/users/jez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jez/subscriptions","organizations_url":"https://api.github.com/users/jez/orgs","repos_url":"https://api.github.com/users/jez/repos","events_url":"https://api.github.com/users/jez/events{/privacy}","received_events_url":"https://api.github.com/users/jez/received_events","type":"User","site_admin":false},"body":"This might not matter (I'm not sure if you plan on keeping this announcements functionality around or if it was just for testing), but what's the point of such a verbose ID field if you're just going to rename it anyway?","created_at":"2016-01-01T19:26:29Z","updated_at":"2016-01-01T19:26:29Z","html_url":"https://github.com/ScottyLabs/tartanhacks/pull/6#discussion_r48679787","pull_request_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/ScottyLabs/tartanhacks/pulls/comments/48679787"},"html":{"href":"https://github.com/ScottyLabs/tartanhacks/pull/6#discussion_r48679787"},"pull_request":{"href":"https://api.github.com/repos/ScottyLabs/tartanhacks/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/ScottyLabs/tartanhacks/pulls/6","id":54698029,"html_url":"https://github.com/ScottyLabs/tartanhacks/pull/6","diff_url":"https://github.com/ScottyLabs/tartanhacks/pull/6.diff","patch_url":"https://github.com/ScottyLabs/tartanhacks/pull/6.patch","issue_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/issues/6","number":6,"state":"open","locked":false,"title":"Core Utils for TH 2016 App","user":{"login":"bezi","id":1945397,"avatar_url":"https://avatars.githubusercontent.com/u/1945397?v=3","gravatar_id":"","url":"https://api.github.com/users/bezi","html_url":"https://github.com/bezi","followers_url":"https://api.github.com/users/bezi/followers","following_url":"https://api.github.com/users/bezi/following{/other_user}","gists_url":"https://api.github.com/users/bezi/gists{/gist_id}","starred_url":"https://api.github.com/users/bezi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bezi/subscriptions","organizations_url":"https://api.github.com/users/bezi/orgs","repos_url":"https://api.github.com/users/bezi/repos","events_url":"https://api.github.com/users/bezi/events{/privacy}","received_events_url":"https://api.github.com/users/bezi/received_events","type":"User","site_admin":false},"body":"While there's not a ton of functionality, I wanna start the code review process early.  At the moment, we've got a React/Flux app set up and talking to a Node.js backend, as well as a Gulpfile that builds it.  I've built a small Announcements widget as a proof of concept and to check that everything's wired together as expected.\r\n\r\nI really want at least @jez and @justingallagher to read this and give feedback, because bugs in the core logic are good to catch early/increase the bus factor of this project from the start. \r\n\r\nThere's a good amount of setup to actually get this working on a local machine (not least, you need nginx and MySQL installed), but that's sort of what has to happen to make we don't have any surprises with operations (at the moment, my test rig is properly routing things through nginx, whose configs are also included).\r\n\r\nMy one concern was that the built and uglified blob was huge (~600K!!).  However, gzipping on Nginx's part slims that down to a very reasonable 148K.\r\n<img width=\"524\" alt=\"benchmark\" src=\"https://cloud.githubusercontent.com/assets/1945397/12028641/796b8508-ada8-11e5-9736-237e876444bc.png\">\r\n\r\n\r\nI'll be dealing with this feedback as I move forward to get auth knocked out. Once that's done, hopefully some of the newer blood can take over some work, or at least know what's going on. Also, I apologize for the gratuitous bootstrap, but it lets me have a decent UI :) Styling is the last thing I'll get to, IMO.  For the near future, you can see a live, working demo at [unix.bezi.io](http://unix.bezi.io), but since that's my dev rig expect it to go up and down sporadically throughout the next few days.","created_at":"2015-12-29T02:21:05Z","updated_at":"2016-01-01T19:26:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/pulls/6/commits","review_comments_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/pulls/6/comments","review_comment_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/issues/6/comments","statuses_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/statuses/b97378f0e9e36b37b6621ccab459eaf3a613013a","head":{"label":"bezi:2016-app","ref":"2016-app","sha":"b97378f0e9e36b37b6621ccab459eaf3a613013a","user":{"login":"bezi","id":1945397,"avatar_url":"https://avatars.githubusercontent.com/u/1945397?v=3","gravatar_id":"","url":"https://api.github.com/users/bezi","html_url":"https://github.com/bezi","followers_url":"https://api.github.com/users/bezi/followers","following_url":"https://api.github.com/users/bezi/following{/other_user}","gists_url":"https://api.github.com/users/bezi/gists{/gist_id}","starred_url":"https://api.github.com/users/bezi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bezi/subscriptions","organizations_url":"https://api.github.com/users/bezi/orgs","repos_url":"https://api.github.com/users/bezi/repos","events_url":"https://api.github.com/users/bezi/events{/privacy}","received_events_url":"https://api.github.com/users/bezi/received_events","type":"User","site_admin":false},"repo":{"id":28494359,"name":"tartanhacks","full_name":"bezi/tartanhacks","owner":{"login":"bezi","id":1945397,"avatar_url":"https://avatars.githubusercontent.com/u/1945397?v=3","gravatar_id":"","url":"https://api.github.com/users/bezi","html_url":"https://github.com/bezi","followers_url":"https://api.github.com/users/bezi/followers","following_url":"https://api.github.com/users/bezi/following{/other_user}","gists_url":"https://api.github.com/users/bezi/gists{/gist_id}","starred_url":"https://api.github.com/users/bezi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bezi/subscriptions","organizations_url":"https://api.github.com/users/bezi/orgs","repos_url":"https://api.github.com/users/bezi/repos","events_url":"https://api.github.com/users/bezi/events{/privacy}","received_events_url":"https://api.github.com/users/bezi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bezi/tartanhacks","description":"Tartanhacks Website 2015","fork":true,"url":"https://api.github.com/repos/bezi/tartanhacks","forks_url":"https://api.github.com/repos/bezi/tartanhacks/forks","keys_url":"https://api.github.com/repos/bezi/tartanhacks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bezi/tartanhacks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bezi/tartanhacks/teams","hooks_url":"https://api.github.com/repos/bezi/tartanhacks/hooks","issue_events_url":"https://api.github.com/repos/bezi/tartanhacks/issues/events{/number}","events_url":"https://api.github.com/repos/bezi/tartanhacks/events","assignees_url":"https://api.github.com/repos/bezi/tartanhacks/assignees{/user}","branches_url":"https://api.github.com/repos/bezi/tartanhacks/branches{/branch}","tags_url":"https://api.github.com/repos/bezi/tartanhacks/tags","blobs_url":"https://api.github.com/repos/bezi/tartanhacks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bezi/tartanhacks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bezi/tartanhacks/git/refs{/sha}","trees_url":"https://api.github.com/repos/bezi/tartanhacks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bezi/tartanhacks/statuses/{sha}","languages_url":"https://api.github.com/repos/bezi/tartanhacks/languages","stargazers_url":"https://api.github.com/repos/bezi/tartanhacks/stargazers","contributors_url":"https://api.github.com/repos/bezi/tartanhacks/contributors","subscribers_url":"https://api.github.com/repos/bezi/tartanhacks/subscribers","subscription_url":"https://api.github.com/repos/bezi/tartanhacks/subscription","commits_url":"https://api.github.com/repos/bezi/tartanhacks/commits{/sha}","git_commits_url":"https://api.github.com/repos/bezi/tartanhacks/git/commits{/sha}","comments_url":"https://api.github.com/repos/bezi/tartanhacks/comments{/number}","issue_comment_url":"https://api.github.com/repos/bezi/tartanhacks/issues/comments{/number}","contents_url":"https://api.github.com/repos/bezi/tartanhacks/contents/{+path}","compare_url":"https://api.github.com/repos/bezi/tartanhacks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bezi/tartanhacks/merges","archive_url":"https://api.github.com/repos/bezi/tartanhacks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bezi/tartanhacks/downloads","issues_url":"https://api.github.com/repos/bezi/tartanhacks/issues{/number}","pulls_url":"https://api.github.com/repos/bezi/tartanhacks/pulls{/number}","milestones_url":"https://api.github.com/repos/bezi/tartanhacks/milestones{/number}","notifications_url":"https://api.github.com/repos/bezi/tartanhacks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bezi/tartanhacks/labels{/name}","releases_url":"https://api.github.com/repos/bezi/tartanhacks/releases{/id}","created_at":"2014-12-26T00:12:30Z","updated_at":"2015-01-16T14:31:52Z","pushed_at":"2015-12-29T02:12:18Z","git_url":"git://github.com/bezi/tartanhacks.git","ssh_url":"git@github.com:bezi/tartanhacks.git","clone_url":"https://github.com/bezi/tartanhacks.git","svn_url":"https://github.com/bezi/tartanhacks","homepage":"","size":899,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"gh-pages"}},"base":{"label":"ScottyLabs:gh-pages","ref":"gh-pages","sha":"8f063dd7bf3b814265e0485da2b5f9a4a413ecbb","user":{"login":"ScottyLabs","id":1393442,"avatar_url":"https://avatars.githubusercontent.com/u/1393442?v=3","gravatar_id":"","url":"https://api.github.com/users/ScottyLabs","html_url":"https://github.com/ScottyLabs","followers_url":"https://api.github.com/users/ScottyLabs/followers","following_url":"https://api.github.com/users/ScottyLabs/following{/other_user}","gists_url":"https://api.github.com/users/ScottyLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/ScottyLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScottyLabs/subscriptions","organizations_url":"https://api.github.com/users/ScottyLabs/orgs","repos_url":"https://api.github.com/users/ScottyLabs/repos","events_url":"https://api.github.com/users/ScottyLabs/events{/privacy}","received_events_url":"https://api.github.com/users/ScottyLabs/received_events","type":"Organization","site_admin":false},"repo":{"id":27036190,"name":"tartanhacks","full_name":"ScottyLabs/tartanhacks","owner":{"login":"ScottyLabs","id":1393442,"avatar_url":"https://avatars.githubusercontent.com/u/1393442?v=3","gravatar_id":"","url":"https://api.github.com/users/ScottyLabs","html_url":"https://github.com/ScottyLabs","followers_url":"https://api.github.com/users/ScottyLabs/followers","following_url":"https://api.github.com/users/ScottyLabs/following{/other_user}","gists_url":"https://api.github.com/users/ScottyLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/ScottyLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScottyLabs/subscriptions","organizations_url":"https://api.github.com/users/ScottyLabs/orgs","repos_url":"https://api.github.com/users/ScottyLabs/repos","events_url":"https://api.github.com/users/ScottyLabs/events{/privacy}","received_events_url":"https://api.github.com/users/ScottyLabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ScottyLabs/tartanhacks","description":"Tartanhacks Website 2015","fork":false,"url":"https://api.github.com/repos/ScottyLabs/tartanhacks","forks_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/forks","keys_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/teams","hooks_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/hooks","issue_events_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/issues/events{/number}","events_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/events","assignees_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/assignees{/user}","branches_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/branches{/branch}","tags_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/tags","blobs_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/git/refs{/sha}","trees_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/statuses/{sha}","languages_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/languages","stargazers_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/stargazers","contributors_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/contributors","subscribers_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/subscribers","subscription_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/subscription","commits_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/commits{/sha}","git_commits_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/git/commits{/sha}","comments_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/comments{/number}","issue_comment_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/issues/comments{/number}","contents_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/contents/{+path}","compare_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/merges","archive_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/downloads","issues_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/issues{/number}","pulls_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/pulls{/number}","milestones_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/milestones{/number}","notifications_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/labels{/name}","releases_url":"https://api.github.com/repos/ScottyLabs/tartanhacks/releases{/id}","created_at":"2014-11-23T15:05:37Z","updated_at":"2015-09-24T21:58:12Z","pushed_at":"2015-12-29T02:21:06Z","git_url":"git://github.com/ScottyLabs/tartanhacks.git","ssh_url":"git@github.com:ScottyLabs/tartanhacks.git","clone_url":"https://github.com/ScottyLabs/tartanhacks.git","svn_url":"https://github.com/ScottyLabs/tartanhacks","homepage":"http://tartanhacks.com","size":288,"stargazers_count":2,"watchers_count":2,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4,"mirror_url":null,"open_issues_count":1,"forks":4,"open_issues":1,"watchers":2,"default_branch":"gh-pages"}},"_links":{"self":{"href":"https://api.github.com/repos/ScottyLabs/tartanhacks/pulls/6"},"html":{"href":"https://github.com/ScottyLabs/tartanhacks/pull/6"},"issue":{"href":"https://api.github.com/repos/ScottyLabs/tartanhacks/issues/6"},"comments":{"href":"https://api.github.com/repos/ScottyLabs/tartanhacks/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/ScottyLabs/tartanhacks/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/ScottyLabs/tartanhacks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ScottyLabs/tartanhacks/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/ScottyLabs/tartanhacks/statuses/b97378f0e9e36b37b6621ccab459eaf3a613013a"}}}}