{"action":"created","comment":{"url":"https://api.github.com/repos/elmzteam/downtothewire/pulls/comments/71075485","id":71075485,"diff_hunk":"@@ -51,64 +57,95 @@ module.exports = function(__dirname) {\n \tapp.use(renderer.handle.bind(renderer))\n \tapp.use(api)\n \n+\t/**\n+\t  * Annotations\n+\t**/ \n+\n+\tvar requireAdmin = (fn) =>\n+\t\tfunction (req, res) {\n+\t\t\tif (req.user) {\n+\t\t\t\treturn fn(req, res)\n+\t\t\t} else {\n+\t\t\t\treq.status(403)\n+\t\t\t\tres.send(\"Please Log In first\")\n+\t\t\t}\n+\t\t}\n \n \t/**\n \t  * App routing\n \t**/\n \n \tapp.use(express.static(\"build\"))\n+\tapp.use(\"/upload\", express.static(config.paths.upload))\n+\n+\tapp.post(\"/visible\", requireAdmin(function(req, res) {\n+\t\thandleVisibility(req.body.state, req.body.page).\n+\t\t\tthen(function() {\n+\t\t\t\tres.status(200)\n+\t\t\t\tres.send({\n+\t\t\t\t\t\"state\": req.body.state ? \"visible\" : \"hidden\",\n+\t\t\t\t\t\"visible\": req.body.state\n+\t\t\t\t})\n+\t\t\t\trenderer.reload()\n+\t\t\t}).\n+\t\t\tcatch(function(err) {\n+\t\t\t\tres.status(500)\n+\t\t\t\tres.send({\n+\t\t\t\t\t\"state\": !req.body.state ? \"visible\" : \"hidden\",\n+\t\t\t\t\t\"visible\": !req.body.state\n+\t\t\t\t})\n+\t\t\t\tlogger.error(err)\n+\t\t\t})\n+\t}))\n \n+\tapp.post(\"/static/\", upload.single('file'), requireAdmin(function(req, res) {\n+\t\tlet hash = req.file.filename.slice(0,8)","path":"server/server.js","position":76,"original_position":76,"commit_id":"efff35f0b6eeb0d89357f25d71571eadf99ae2be","original_commit_id":"efff35f0b6eeb0d89357f25d71571eadf99ae2be","user":{"login":"bluepichu","id":1878074,"avatar_url":"https://avatars.githubusercontent.com/u/1878074?v=3","gravatar_id":"","url":"https://api.github.com/users/bluepichu","html_url":"https://github.com/bluepichu","followers_url":"https://api.github.com/users/bluepichu/followers","following_url":"https://api.github.com/users/bluepichu/following{/other_user}","gists_url":"https://api.github.com/users/bluepichu/gists{/gist_id}","starred_url":"https://api.github.com/users/bluepichu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluepichu/subscriptions","organizations_url":"https://api.github.com/users/bluepichu/orgs","repos_url":"https://api.github.com/users/bluepichu/repos","events_url":"https://api.github.com/users/bluepichu/events{/privacy}","received_events_url":"https://api.github.com/users/bluepichu/received_events","type":"User","site_admin":false},"body":"...am I missing something here?  How is this a hash?","created_at":"2016-07-17T02:38:19Z","updated_at":"2016-07-17T02:38:19Z","html_url":"https://github.com/elmzteam/downtothewire/pull/107#discussion_r71075485","pull_request_url":"https://api.github.com/repos/elmzteam/downtothewire/pulls/107","_links":{"self":{"href":"https://api.github.com/repos/elmzteam/downtothewire/pulls/comments/71075485"},"html":{"href":"https://github.com/elmzteam/downtothewire/pull/107#discussion_r71075485"},"pull_request":{"href":"https://api.github.com/repos/elmzteam/downtothewire/pulls/107"}}},"pull_request":{"url":"https://api.github.com/repos/elmzteam/downtothewire/pulls/107","id":77724500,"html_url":"https://github.com/elmzteam/downtothewire/pull/107","diff_url":"https://github.com/elmzteam/downtothewire/pull/107.diff","patch_url":"https://github.com/elmzteam/downtothewire/pull/107.patch","issue_url":"https://api.github.com/repos/elmzteam/downtothewire/issues/107","number":107,"state":"open","locked":false,"title":"Add static file upload","user":{"login":"zwade","id":1497954,"avatar_url":"https://avatars.githubusercontent.com/u/1497954?v=3","gravatar_id":"","url":"https://api.github.com/users/zwade","html_url":"https://github.com/zwade","followers_url":"https://api.github.com/users/zwade/followers","following_url":"https://api.github.com/users/zwade/following{/other_user}","gists_url":"https://api.github.com/users/zwade/gists{/gist_id}","starred_url":"https://api.github.com/users/zwade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zwade/subscriptions","organizations_url":"https://api.github.com/users/zwade/orgs","repos_url":"https://api.github.com/users/zwade/repos","events_url":"https://api.github.com/users/zwade/events{/privacy}","received_events_url":"https://api.github.com/users/zwade/received_events","type":"User","site_admin":false},"body":"[Resolves #105] Includes a way to upload from the editor, and a standalone admin file manager.","created_at":"2016-07-17T02:14:00Z","updated_at":"2016-07-17T02:38:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c19f83f0690904656f0ec0b6b9ab7ddae8b6d4b8","assignee":{"login":"bluepichu","id":1878074,"avatar_url":"https://avatars.githubusercontent.com/u/1878074?v=3","gravatar_id":"","url":"https://api.github.com/users/bluepichu","html_url":"https://github.com/bluepichu","followers_url":"https://api.github.com/users/bluepichu/followers","following_url":"https://api.github.com/users/bluepichu/following{/other_user}","gists_url":"https://api.github.com/users/bluepichu/gists{/gist_id}","starred_url":"https://api.github.com/users/bluepichu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluepichu/subscriptions","organizations_url":"https://api.github.com/users/bluepichu/orgs","repos_url":"https://api.github.com/users/bluepichu/repos","events_url":"https://api.github.com/users/bluepichu/events{/privacy}","received_events_url":"https://api.github.com/users/bluepichu/received_events","type":"User","site_admin":false},"assignees":[{"login":"bluepichu","id":1878074,"avatar_url":"https://avatars.githubusercontent.com/u/1878074?v=3","gravatar_id":"","url":"https://api.github.com/users/bluepichu","html_url":"https://github.com/bluepichu","followers_url":"https://api.github.com/users/bluepichu/followers","following_url":"https://api.github.com/users/bluepichu/following{/other_user}","gists_url":"https://api.github.com/users/bluepichu/gists{/gist_id}","starred_url":"https://api.github.com/users/bluepichu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluepichu/subscriptions","organizations_url":"https://api.github.com/users/bluepichu/orgs","repos_url":"https://api.github.com/users/bluepichu/repos","events_url":"https://api.github.com/users/bluepichu/events{/privacy}","received_events_url":"https://api.github.com/users/bluepichu/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elmzteam/downtothewire/pulls/107/commits","review_comments_url":"https://api.github.com/repos/elmzteam/downtothewire/pulls/107/comments","review_comment_url":"https://api.github.com/repos/elmzteam/downtothewire/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elmzteam/downtothewire/issues/107/comments","statuses_url":"https://api.github.com/repos/elmzteam/downtothewire/statuses/efff35f0b6eeb0d89357f25d71571eadf99ae2be","head":{"label":"zwade:issue105","ref":"issue105","sha":"efff35f0b6eeb0d89357f25d71571eadf99ae2be","user":{"login":"zwade","id":1497954,"avatar_url":"https://avatars.githubusercontent.com/u/1497954?v=3","gravatar_id":"","url":"https://api.github.com/users/zwade","html_url":"https://github.com/zwade","followers_url":"https://api.github.com/users/zwade/followers","following_url":"https://api.github.com/users/zwade/following{/other_user}","gists_url":"https://api.github.com/users/zwade/gists{/gist_id}","starred_url":"https://api.github.com/users/zwade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zwade/subscriptions","organizations_url":"https://api.github.com/users/zwade/orgs","repos_url":"https://api.github.com/users/zwade/repos","events_url":"https://api.github.com/users/zwade/events{/privacy}","received_events_url":"https://api.github.com/users/zwade/received_events","type":"User","site_admin":false},"repo":{"id":55424798,"name":"bydesign","full_name":"zwade/bydesign","owner":{"login":"zwade","id":1497954,"avatar_url":"https://avatars.githubusercontent.com/u/1497954?v=3","gravatar_id":"","url":"https://api.github.com/users/zwade","html_url":"https://github.com/zwade","followers_url":"https://api.github.com/users/zwade/followers","following_url":"https://api.github.com/users/zwade/following{/other_user}","gists_url":"https://api.github.com/users/zwade/gists{/gist_id}","starred_url":"https://api.github.com/users/zwade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zwade/subscriptions","organizations_url":"https://api.github.com/users/zwade/orgs","repos_url":"https://api.github.com/users/zwade/repos","events_url":"https://api.github.com/users/zwade/events{/privacy}","received_events_url":"https://api.github.com/users/zwade/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zwade/bydesign","description":"Blog Platform for jsby.design","fork":true,"url":"https://api.github.com/repos/zwade/bydesign","forks_url":"https://api.github.com/repos/zwade/bydesign/forks","keys_url":"https://api.github.com/repos/zwade/bydesign/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zwade/bydesign/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zwade/bydesign/teams","hooks_url":"https://api.github.com/repos/zwade/bydesign/hooks","issue_events_url":"https://api.github.com/repos/zwade/bydesign/issues/events{/number}","events_url":"https://api.github.com/repos/zwade/bydesign/events","assignees_url":"https://api.github.com/repos/zwade/bydesign/assignees{/user}","branches_url":"https://api.github.com/repos/zwade/bydesign/branches{/branch}","tags_url":"https://api.github.com/repos/zwade/bydesign/tags","blobs_url":"https://api.github.com/repos/zwade/bydesign/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zwade/bydesign/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zwade/bydesign/git/refs{/sha}","trees_url":"https://api.github.com/repos/zwade/bydesign/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zwade/bydesign/statuses/{sha}","languages_url":"https://api.github.com/repos/zwade/bydesign/languages","stargazers_url":"https://api.github.com/repos/zwade/bydesign/stargazers","contributors_url":"https://api.github.com/repos/zwade/bydesign/contributors","subscribers_url":"https://api.github.com/repos/zwade/bydesign/subscribers","subscription_url":"https://api.github.com/repos/zwade/bydesign/subscription","commits_url":"https://api.github.com/repos/zwade/bydesign/commits{/sha}","git_commits_url":"https://api.github.com/repos/zwade/bydesign/git/commits{/sha}","comments_url":"https://api.github.com/repos/zwade/bydesign/comments{/number}","issue_comment_url":"https://api.github.com/repos/zwade/bydesign/issues/comments{/number}","contents_url":"https://api.github.com/repos/zwade/bydesign/contents/{+path}","compare_url":"https://api.github.com/repos/zwade/bydesign/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zwade/bydesign/merges","archive_url":"https://api.github.com/repos/zwade/bydesign/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zwade/bydesign/downloads","issues_url":"https://api.github.com/repos/zwade/bydesign/issues{/number}","pulls_url":"https://api.github.com/repos/zwade/bydesign/pulls{/number}","milestones_url":"https://api.github.com/repos/zwade/bydesign/milestones{/number}","notifications_url":"https://api.github.com/repos/zwade/bydesign/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zwade/bydesign/labels{/name}","releases_url":"https://api.github.com/repos/zwade/bydesign/releases{/id}","deployments_url":"https://api.github.com/repos/zwade/bydesign/deployments","created_at":"2016-04-04T15:57:06Z","updated_at":"2016-04-04T15:57:07Z","pushed_at":"2016-07-17T02:10:31Z","git_url":"git://github.com/zwade/bydesign.git","ssh_url":"git@github.com:zwade/bydesign.git","clone_url":"https://github.com/zwade/bydesign.git","svn_url":"https://github.com/zwade/bydesign","homepage":null,"size":750,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elmzteam:master","ref":"master","sha":"44a29f42ff61a75fe68c23decf68c58451672b13","user":{"login":"elmzteam","id":13486143,"avatar_url":"https://avatars.githubusercontent.com/u/13486143?v=3","gravatar_id":"","url":"https://api.github.com/users/elmzteam","html_url":"https://github.com/elmzteam","followers_url":"https://api.github.com/users/elmzteam/followers","following_url":"https://api.github.com/users/elmzteam/following{/other_user}","gists_url":"https://api.github.com/users/elmzteam/gists{/gist_id}","starred_url":"https://api.github.com/users/elmzteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elmzteam/subscriptions","organizations_url":"https://api.github.com/users/elmzteam/orgs","repos_url":"https://api.github.com/users/elmzteam/repos","events_url":"https://api.github.com/users/elmzteam/events{/privacy}","received_events_url":"https://api.github.com/users/elmzteam/received_events","type":"Organization","site_admin":false},"repo":{"id":47130277,"name":"downtothewire","full_name":"elmzteam/downtothewire","owner":{"login":"elmzteam","id":13486143,"avatar_url":"https://avatars.githubusercontent.com/u/13486143?v=3","gravatar_id":"","url":"https://api.github.com/users/elmzteam","html_url":"https://github.com/elmzteam","followers_url":"https://api.github.com/users/elmzteam/followers","following_url":"https://api.github.com/users/elmzteam/following{/other_user}","gists_url":"https://api.github.com/users/elmzteam/gists{/gist_id}","starred_url":"https://api.github.com/users/elmzteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elmzteam/subscriptions","organizations_url":"https://api.github.com/users/elmzteam/orgs","repos_url":"https://api.github.com/users/elmzteam/repos","events_url":"https://api.github.com/users/elmzteam/events{/privacy}","received_events_url":"https://api.github.com/users/elmzteam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elmzteam/downtothewire","description":"Blog Platform for jsby.design","fork":false,"url":"https://api.github.com/repos/elmzteam/downtothewire","forks_url":"https://api.github.com/repos/elmzteam/downtothewire/forks","keys_url":"https://api.github.com/repos/elmzteam/downtothewire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elmzteam/downtothewire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elmzteam/downtothewire/teams","hooks_url":"https://api.github.com/repos/elmzteam/downtothewire/hooks","issue_events_url":"https://api.github.com/repos/elmzteam/downtothewire/issues/events{/number}","events_url":"https://api.github.com/repos/elmzteam/downtothewire/events","assignees_url":"https://api.github.com/repos/elmzteam/downtothewire/assignees{/user}","branches_url":"https://api.github.com/repos/elmzteam/downtothewire/branches{/branch}","tags_url":"https://api.github.com/repos/elmzteam/downtothewire/tags","blobs_url":"https://api.github.com/repos/elmzteam/downtothewire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elmzteam/downtothewire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elmzteam/downtothewire/git/refs{/sha}","trees_url":"https://api.github.com/repos/elmzteam/downtothewire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elmzteam/downtothewire/statuses/{sha}","languages_url":"https://api.github.com/repos/elmzteam/downtothewire/languages","stargazers_url":"https://api.github.com/repos/elmzteam/downtothewire/stargazers","contributors_url":"https://api.github.com/repos/elmzteam/downtothewire/contributors","subscribers_url":"https://api.github.com/repos/elmzteam/downtothewire/subscribers","subscription_url":"https://api.github.com/repos/elmzteam/downtothewire/subscription","commits_url":"https://api.github.com/repos/elmzteam/downtothewire/commits{/sha}","git_commits_url":"https://api.github.com/repos/elmzteam/downtothewire/git/commits{/sha}","comments_url":"https://api.github.com/repos/elmzteam/downtothewire/comments{/number}","issue_comment_url":"https://api.github.com/repos/elmzteam/downtothewire/issues/comments{/number}","contents_url":"https://api.github.com/repos/elmzteam/downtothewire/contents/{+path}","compare_url":"https://api.github.com/repos/elmzteam/downtothewire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elmzteam/downtothewire/merges","archive_url":"https://api.github.com/repos/elmzteam/downtothewire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elmzteam/downtothewire/downloads","issues_url":"https://api.github.com/repos/elmzteam/downtothewire/issues{/number}","pulls_url":"https://api.github.com/repos/elmzteam/downtothewire/pulls{/number}","milestones_url":"https://api.github.com/repos/elmzteam/downtothewire/milestones{/number}","notifications_url":"https://api.github.com/repos/elmzteam/downtothewire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elmzteam/downtothewire/labels{/name}","releases_url":"https://api.github.com/repos/elmzteam/downtothewire/releases{/id}","deployments_url":"https://api.github.com/repos/elmzteam/downtothewire/deployments","created_at":"2015-11-30T16:08:52Z","updated_at":"2016-07-10T17:52:14Z","pushed_at":"2016-07-17T02:14:00Z","git_url":"git://github.com/elmzteam/downtothewire.git","ssh_url":"git@github.com:elmzteam/downtothewire.git","clone_url":"https://github.com/elmzteam/downtothewire.git","svn_url":"https://github.com/elmzteam/downtothewire","homepage":null,"size":748,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":12,"forks":1,"open_issues":12,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elmzteam/downtothewire/pulls/107"},"html":{"href":"https://github.com/elmzteam/downtothewire/pull/107"},"issue":{"href":"https://api.github.com/repos/elmzteam/downtothewire/issues/107"},"comments":{"href":"https://api.github.com/repos/elmzteam/downtothewire/issues/107/comments"},"review_comments":{"href":"https://api.github.com/repos/elmzteam/downtothewire/pulls/107/comments"},"review_comment":{"href":"https://api.github.com/repos/elmzteam/downtothewire/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elmzteam/downtothewire/pulls/107/commits"},"statuses":{"href":"https://api.github.com/repos/elmzteam/downtothewire/statuses/efff35f0b6eeb0d89357f25d71571eadf99ae2be"}}}}
{"actor":{"display_login":"bluepichu"}}