{"action":"created","comment":{"url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/pulls/comments/185046835","pull_request_review_id":116355193,"id":185046835,"diff_hunk":"@@ -1,7 +1,66 @@\n-var express = require('express');\n-var app = express();\n-\n+const express = require('express');\n+const app = express();\n+const bodyParser = require('body-parser');\n+const fs = require(\"fs\");\n+const functional = require('./server/functionalServer.js');\n+const way = './server/data/posts.json';\n app.use('/', express.static('public'));\n+app.use(bodyParser.json());\n+\n+app.get('/getPost', (req, res) => {\n+    let post = functional.getPhotoPost(req.query.id.toString());\n+    if (post) {\n+        res.send(post).end();\n+    } else {\n+        res.send(404).end();\n+    }\n+});\n+app.delete('/removePhotoPost', (req, res) => {\n+    let post = functional.removePhotoPostLabeled(req.query.id.toString());\n+    console.log(post);\n+    if(post){\n+        fs.writeFileSync(way,JSON.stringify(functional.getAllPosts()));\n+        res.send('post with id = ' + req.query.id + ' is deleted').end(200);\n+    }\n+    else{\n+        res.send(404).end(\"Post not found\");\n+    }\n+});\n+app.post('/addPhotoPost', (req, res) => {\n+    let addPost = functional.addPhotoPost(req.body);","path":"Site/app.js","position":33,"original_position":33,"commit_id":"2800f690d951374c7865ebe3933ea0dde2d17ed2","original_commit_id":"2800f690d951374c7865ebe3933ea0dde2d17ed2","user":{"login":"ala-n","id":8127830,"avatar_url":"https://avatars2.githubusercontent.com/u/8127830?v=4","gravatar_id":"","url":"https://api.github.com/users/ala-n","html_url":"https://github.com/ala-n","followers_url":"https://api.github.com/users/ala-n/followers","following_url":"https://api.github.com/users/ala-n/following{/other_user}","gists_url":"https://api.github.com/users/ala-n/gists{/gist_id}","starred_url":"https://api.github.com/users/ala-n/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ala-n/subscriptions","organizations_url":"https://api.github.com/users/ala-n/orgs","repos_url":"https://api.github.com/users/ala-n/repos","events_url":"https://api.github.com/users/ala-n/events{/privacy}","received_events_url":"https://api.github.com/users/ala-n/received_events","type":"User","site_admin":false},"body":"CleanCode: переменная со значением а название глагол ;)","created_at":"2018-04-30T17:03:39Z","updated_at":"2018-04-30T17:39:48Z","html_url":"https://github.com/KoltunDmitry/TrainingPractice/pull/15#discussion_r185046835","pull_request_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/pulls/15","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/pulls/comments/185046835"},"html":{"href":"https://github.com/KoltunDmitry/TrainingPractice/pull/15#discussion_r185046835"},"pull_request":{"href":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/pulls/15","id":183651202,"html_url":"https://github.com/KoltunDmitry/TrainingPractice/pull/15","diff_url":"https://github.com/KoltunDmitry/TrainingPractice/pull/15.diff","patch_url":"https://github.com/KoltunDmitry/TrainingPractice/pull/15.patch","issue_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/issues/15","number":15,"state":"open","locked":false,"title":"Lab8","user":{"login":"KoltunDmitry","id":28831724,"avatar_url":"https://avatars0.githubusercontent.com/u/28831724?v=4","gravatar_id":"","url":"https://api.github.com/users/KoltunDmitry","html_url":"https://github.com/KoltunDmitry","followers_url":"https://api.github.com/users/KoltunDmitry/followers","following_url":"https://api.github.com/users/KoltunDmitry/following{/other_user}","gists_url":"https://api.github.com/users/KoltunDmitry/gists{/gist_id}","starred_url":"https://api.github.com/users/KoltunDmitry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KoltunDmitry/subscriptions","organizations_url":"https://api.github.com/users/KoltunDmitry/orgs","repos_url":"https://api.github.com/users/KoltunDmitry/repos","events_url":"https://api.github.com/users/KoltunDmitry/events{/privacy}","received_events_url":"https://api.github.com/users/KoltunDmitry/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-04-24T08:03:05Z","updated_at":"2018-04-30T17:39:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"29afeaafca3096434a64b2c4ff427f9c0a3ec733","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/pulls/15/commits","review_comments_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/pulls/15/comments","review_comment_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/pulls/comments{/number}","comments_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/issues/15/comments","statuses_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/statuses/2800f690d951374c7865ebe3933ea0dde2d17ed2","head":{"label":"KoltunDmitry:lab8","ref":"lab8","sha":"2800f690d951374c7865ebe3933ea0dde2d17ed2","user":{"login":"KoltunDmitry","id":28831724,"avatar_url":"https://avatars0.githubusercontent.com/u/28831724?v=4","gravatar_id":"","url":"https://api.github.com/users/KoltunDmitry","html_url":"https://github.com/KoltunDmitry","followers_url":"https://api.github.com/users/KoltunDmitry/followers","following_url":"https://api.github.com/users/KoltunDmitry/following{/other_user}","gists_url":"https://api.github.com/users/KoltunDmitry/gists{/gist_id}","starred_url":"https://api.github.com/users/KoltunDmitry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KoltunDmitry/subscriptions","organizations_url":"https://api.github.com/users/KoltunDmitry/orgs","repos_url":"https://api.github.com/users/KoltunDmitry/repos","events_url":"https://api.github.com/users/KoltunDmitry/events{/privacy}","received_events_url":"https://api.github.com/users/KoltunDmitry/received_events","type":"User","site_admin":false},"repo":{"id":120419690,"name":"TrainingPractice","full_name":"KoltunDmitry/TrainingPractice","owner":{"login":"KoltunDmitry","id":28831724,"avatar_url":"https://avatars0.githubusercontent.com/u/28831724?v=4","gravatar_id":"","url":"https://api.github.com/users/KoltunDmitry","html_url":"https://github.com/KoltunDmitry","followers_url":"https://api.github.com/users/KoltunDmitry/followers","following_url":"https://api.github.com/users/KoltunDmitry/following{/other_user}","gists_url":"https://api.github.com/users/KoltunDmitry/gists{/gist_id}","starred_url":"https://api.github.com/users/KoltunDmitry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KoltunDmitry/subscriptions","organizations_url":"https://api.github.com/users/KoltunDmitry/orgs","repos_url":"https://api.github.com/users/KoltunDmitry/repos","events_url":"https://api.github.com/users/KoltunDmitry/events{/privacy}","received_events_url":"https://api.github.com/users/KoltunDmitry/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/KoltunDmitry/TrainingPractice","description":null,"fork":false,"url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice","forks_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/forks","keys_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/teams","hooks_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/hooks","issue_events_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/issues/events{/number}","events_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/events","assignees_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/assignees{/user}","branches_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/branches{/branch}","tags_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/tags","blobs_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/git/refs{/sha}","trees_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/statuses/{sha}","languages_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/languages","stargazers_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/stargazers","contributors_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/contributors","subscribers_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/subscribers","subscription_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/subscription","commits_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/commits{/sha}","git_commits_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/git/commits{/sha}","comments_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/comments{/number}","issue_comment_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/issues/comments{/number}","contents_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/contents/{+path}","compare_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/merges","archive_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/downloads","issues_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/issues{/number}","pulls_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/pulls{/number}","milestones_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/milestones{/number}","notifications_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/labels{/name}","releases_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/releases{/id}","deployments_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/deployments","created_at":"2018-02-06T07:45:52Z","updated_at":"2018-04-22T19:23:19Z","pushed_at":"2018-04-24T08:03:06Z","git_url":"git://github.com/KoltunDmitry/TrainingPractice.git","ssh_url":"git@github.com:KoltunDmitry/TrainingPractice.git","clone_url":"https://github.com/KoltunDmitry/TrainingPractice.git","svn_url":"https://github.com/KoltunDmitry/TrainingPractice","homepage":null,"size":3696,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"KoltunDmitry:master","ref":"master","sha":"30bb21dfbb090f6fa185c4be29266ef464a991c9","user":{"login":"KoltunDmitry","id":28831724,"avatar_url":"https://avatars0.githubusercontent.com/u/28831724?v=4","gravatar_id":"","url":"https://api.github.com/users/KoltunDmitry","html_url":"https://github.com/KoltunDmitry","followers_url":"https://api.github.com/users/KoltunDmitry/followers","following_url":"https://api.github.com/users/KoltunDmitry/following{/other_user}","gists_url":"https://api.github.com/users/KoltunDmitry/gists{/gist_id}","starred_url":"https://api.github.com/users/KoltunDmitry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KoltunDmitry/subscriptions","organizations_url":"https://api.github.com/users/KoltunDmitry/orgs","repos_url":"https://api.github.com/users/KoltunDmitry/repos","events_url":"https://api.github.com/users/KoltunDmitry/events{/privacy}","received_events_url":"https://api.github.com/users/KoltunDmitry/received_events","type":"User","site_admin":false},"repo":{"id":120419690,"name":"TrainingPractice","full_name":"KoltunDmitry/TrainingPractice","owner":{"login":"KoltunDmitry","id":28831724,"avatar_url":"https://avatars0.githubusercontent.com/u/28831724?v=4","gravatar_id":"","url":"https://api.github.com/users/KoltunDmitry","html_url":"https://github.com/KoltunDmitry","followers_url":"https://api.github.com/users/KoltunDmitry/followers","following_url":"https://api.github.com/users/KoltunDmitry/following{/other_user}","gists_url":"https://api.github.com/users/KoltunDmitry/gists{/gist_id}","starred_url":"https://api.github.com/users/KoltunDmitry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KoltunDmitry/subscriptions","organizations_url":"https://api.github.com/users/KoltunDmitry/orgs","repos_url":"https://api.github.com/users/KoltunDmitry/repos","events_url":"https://api.github.com/users/KoltunDmitry/events{/privacy}","received_events_url":"https://api.github.com/users/KoltunDmitry/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/KoltunDmitry/TrainingPractice","description":null,"fork":false,"url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice","forks_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/forks","keys_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/teams","hooks_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/hooks","issue_events_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/issues/events{/number}","events_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/events","assignees_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/assignees{/user}","branches_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/branches{/branch}","tags_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/tags","blobs_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/git/refs{/sha}","trees_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/statuses/{sha}","languages_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/languages","stargazers_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/stargazers","contributors_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/contributors","subscribers_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/subscribers","subscription_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/subscription","commits_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/commits{/sha}","git_commits_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/git/commits{/sha}","comments_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/comments{/number}","issue_comment_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/issues/comments{/number}","contents_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/contents/{+path}","compare_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/merges","archive_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/downloads","issues_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/issues{/number}","pulls_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/pulls{/number}","milestones_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/milestones{/number}","notifications_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/labels{/name}","releases_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/releases{/id}","deployments_url":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/deployments","created_at":"2018-02-06T07:45:52Z","updated_at":"2018-04-22T19:23:19Z","pushed_at":"2018-04-24T08:03:06Z","git_url":"git://github.com/KoltunDmitry/TrainingPractice.git","ssh_url":"git@github.com:KoltunDmitry/TrainingPractice.git","clone_url":"https://github.com/KoltunDmitry/TrainingPractice.git","svn_url":"https://github.com/KoltunDmitry/TrainingPractice","homepage":null,"size":3696,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/pulls/15"},"html":{"href":"https://github.com/KoltunDmitry/TrainingPractice/pull/15"},"issue":{"href":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/issues/15"},"comments":{"href":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/KoltunDmitry/TrainingPractice/statuses/2800f690d951374c7865ebe3933ea0dde2d17ed2"}},"author_association":"OWNER"}}
{"actor":{"display_login":"ala-n"}}