{"action":"created","comment":{"url":"https://api.github.com/repos/doomspork/elixir-school/pulls/comments/71582327","id":71582327,"diff_hunk":"@@ -0,0 +1,235 @@\n+---\n+layout: page\n+title: Plug\n+category: specifics\n+order: 1\n+lang: ru\n+---\n+\n+Если вы знакомы с Ruby, то можете думать о модулях Plug как о Rack с добавкой Sinatra. Они предоставляют спецификацию для компонентов веб-приложений и адаптеры для веб-серверов. Хотя Plug и не являются частью ядра Elixir, это официальный проект Elixir.\n+\n+{% include toc.html %}\n+\n+## Установка\n+\n+Plug элементарно устанавливаются с помощью mix. Для установки Plug нам необходимо внести два небольших изменения в наш файл `mix.exs`. Первое, что необходимо сделать, это добавить Plug и веб-сервер на выбор (мы будем использовать Cowboy) в наш файл в качестве зависимостей:\n+\n+```elixir\n+defp deps do\n+  [{:cowboy, \"~> 1.0.0\"},\n+   {:plug, \"~> 1.0\"}]\n+end\n+```\n+\n+Второе, что нам надо, это добавить веб-сервер и Plug к нашему OTP приложению:\n+\n+```elixir\n+def application do\n+  [applications: [:cowboy, :logger, :plug]]\n+end\n+```\n+\n+## Спецификация\n+\n+Чтобы начать создавать собственные модули Plug, нам нужно знать и придерживаться спецификации Plug. К счастью, необходимо реализовать всего две функции: `init/1` и `call/2`.","path":"ru/lessons/specifics/plug.md","position":34,"original_position":34,"commit_id":"cdca7ea9452930c5ce783f1ab14eae0c49b7c4fa","original_commit_id":"cdca7ea9452930c5ce783f1ab14eae0c49b7c4fa","user":{"login":"brain-geek","id":307982,"avatar_url":"https://avatars.githubusercontent.com/u/307982?v=3","gravatar_id":"","url":"https://api.github.com/users/brain-geek","html_url":"https://github.com/brain-geek","followers_url":"https://api.github.com/users/brain-geek/followers","following_url":"https://api.github.com/users/brain-geek/following{/other_user}","gists_url":"https://api.github.com/users/brain-geek/gists{/gist_id}","starred_url":"https://api.github.com/users/brain-geek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brain-geek/subscriptions","organizations_url":"https://api.github.com/users/brain-geek/orgs","repos_url":"https://api.github.com/users/brain-geek/repos","events_url":"https://api.github.com/users/brain-geek/events{/privacy}","received_events_url":"https://api.github.com/users/brain-geek/received_events","type":"User","site_admin":false},"body":"`нам нужно знать и придерживаться спецификации Plug` -> `нужно придерживаться спецификации` ?","created_at":"2016-07-20T18:39:02Z","updated_at":"2016-07-20T18:39:02Z","html_url":"https://github.com/doomspork/elixir-school/pull/542#discussion_r71582327","pull_request_url":"https://api.github.com/repos/doomspork/elixir-school/pulls/542","_links":{"self":{"href":"https://api.github.com/repos/doomspork/elixir-school/pulls/comments/71582327"},"html":{"href":"https://github.com/doomspork/elixir-school/pull/542#discussion_r71582327"},"pull_request":{"href":"https://api.github.com/repos/doomspork/elixir-school/pulls/542"}}},"pull_request":{"url":"https://api.github.com/repos/doomspork/elixir-school/pulls/542","id":78190672,"html_url":"https://github.com/doomspork/elixir-school/pull/542","diff_url":"https://github.com/doomspork/elixir-school/pull/542.diff","patch_url":"https://github.com/doomspork/elixir-school/pull/542.patch","issue_url":"https://api.github.com/repos/doomspork/elixir-school/issues/542","number":542,"state":"open","locked":false,"title":"[RU] plug.md translation","user":{"login":"yuriibodarev","id":14310587,"avatar_url":"https://avatars.githubusercontent.com/u/14310587?v=3","gravatar_id":"","url":"https://api.github.com/users/yuriibodarev","html_url":"https://github.com/yuriibodarev","followers_url":"https://api.github.com/users/yuriibodarev/followers","following_url":"https://api.github.com/users/yuriibodarev/following{/other_user}","gists_url":"https://api.github.com/users/yuriibodarev/gists{/gist_id}","starred_url":"https://api.github.com/users/yuriibodarev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuriibodarev/subscriptions","organizations_url":"https://api.github.com/users/yuriibodarev/orgs","repos_url":"https://api.github.com/users/yuriibodarev/repos","events_url":"https://api.github.com/users/yuriibodarev/events{/privacy}","received_events_url":"https://api.github.com/users/yuriibodarev/received_events","type":"User","site_admin":false},"body":"Hello, please check my `plug.md` translation and provide your comments, suggestions and corrections! Thanks!","created_at":"2016-07-20T17:53:59Z","updated_at":"2016-07-20T18:39:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8745920699c27d0d74808ca279e4a06d47887938","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/doomspork/elixir-school/pulls/542/commits","review_comments_url":"https://api.github.com/repos/doomspork/elixir-school/pulls/542/comments","review_comment_url":"https://api.github.com/repos/doomspork/elixir-school/pulls/comments{/number}","comments_url":"https://api.github.com/repos/doomspork/elixir-school/issues/542/comments","statuses_url":"https://api.github.com/repos/doomspork/elixir-school/statuses/cdca7ea9452930c5ce783f1ab14eae0c49b7c4fa","head":{"label":"yuriibodarev:master","ref":"master","sha":"cdca7ea9452930c5ce783f1ab14eae0c49b7c4fa","user":{"login":"yuriibodarev","id":14310587,"avatar_url":"https://avatars.githubusercontent.com/u/14310587?v=3","gravatar_id":"","url":"https://api.github.com/users/yuriibodarev","html_url":"https://github.com/yuriibodarev","followers_url":"https://api.github.com/users/yuriibodarev/followers","following_url":"https://api.github.com/users/yuriibodarev/following{/other_user}","gists_url":"https://api.github.com/users/yuriibodarev/gists{/gist_id}","starred_url":"https://api.github.com/users/yuriibodarev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuriibodarev/subscriptions","organizations_url":"https://api.github.com/users/yuriibodarev/orgs","repos_url":"https://api.github.com/users/yuriibodarev/repos","events_url":"https://api.github.com/users/yuriibodarev/events{/privacy}","received_events_url":"https://api.github.com/users/yuriibodarev/received_events","type":"User","site_admin":false},"repo":{"id":62221313,"name":"elixir-school","full_name":"yuriibodarev/elixir-school","owner":{"login":"yuriibodarev","id":14310587,"avatar_url":"https://avatars.githubusercontent.com/u/14310587?v=3","gravatar_id":"","url":"https://api.github.com/users/yuriibodarev","html_url":"https://github.com/yuriibodarev","followers_url":"https://api.github.com/users/yuriibodarev/followers","following_url":"https://api.github.com/users/yuriibodarev/following{/other_user}","gists_url":"https://api.github.com/users/yuriibodarev/gists{/gist_id}","starred_url":"https://api.github.com/users/yuriibodarev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuriibodarev/subscriptions","organizations_url":"https://api.github.com/users/yuriibodarev/orgs","repos_url":"https://api.github.com/users/yuriibodarev/repos","events_url":"https://api.github.com/users/yuriibodarev/events{/privacy}","received_events_url":"https://api.github.com/users/yuriibodarev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yuriibodarev/elixir-school","description":"Lessons about the Elixir programming language","fork":true,"url":"https://api.github.com/repos/yuriibodarev/elixir-school","forks_url":"https://api.github.com/repos/yuriibodarev/elixir-school/forks","keys_url":"https://api.github.com/repos/yuriibodarev/elixir-school/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yuriibodarev/elixir-school/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yuriibodarev/elixir-school/teams","hooks_url":"https://api.github.com/repos/yuriibodarev/elixir-school/hooks","issue_events_url":"https://api.github.com/repos/yuriibodarev/elixir-school/issues/events{/number}","events_url":"https://api.github.com/repos/yuriibodarev/elixir-school/events","assignees_url":"https://api.github.com/repos/yuriibodarev/elixir-school/assignees{/user}","branches_url":"https://api.github.com/repos/yuriibodarev/elixir-school/branches{/branch}","tags_url":"https://api.github.com/repos/yuriibodarev/elixir-school/tags","blobs_url":"https://api.github.com/repos/yuriibodarev/elixir-school/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yuriibodarev/elixir-school/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yuriibodarev/elixir-school/git/refs{/sha}","trees_url":"https://api.github.com/repos/yuriibodarev/elixir-school/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yuriibodarev/elixir-school/statuses/{sha}","languages_url":"https://api.github.com/repos/yuriibodarev/elixir-school/languages","stargazers_url":"https://api.github.com/repos/yuriibodarev/elixir-school/stargazers","contributors_url":"https://api.github.com/repos/yuriibodarev/elixir-school/contributors","subscribers_url":"https://api.github.com/repos/yuriibodarev/elixir-school/subscribers","subscription_url":"https://api.github.com/repos/yuriibodarev/elixir-school/subscription","commits_url":"https://api.github.com/repos/yuriibodarev/elixir-school/commits{/sha}","git_commits_url":"https://api.github.com/repos/yuriibodarev/elixir-school/git/commits{/sha}","comments_url":"https://api.github.com/repos/yuriibodarev/elixir-school/comments{/number}","issue_comment_url":"https://api.github.com/repos/yuriibodarev/elixir-school/issues/comments{/number}","contents_url":"https://api.github.com/repos/yuriibodarev/elixir-school/contents/{+path}","compare_url":"https://api.github.com/repos/yuriibodarev/elixir-school/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yuriibodarev/elixir-school/merges","archive_url":"https://api.github.com/repos/yuriibodarev/elixir-school/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yuriibodarev/elixir-school/downloads","issues_url":"https://api.github.com/repos/yuriibodarev/elixir-school/issues{/number}","pulls_url":"https://api.github.com/repos/yuriibodarev/elixir-school/pulls{/number}","milestones_url":"https://api.github.com/repos/yuriibodarev/elixir-school/milestones{/number}","notifications_url":"https://api.github.com/repos/yuriibodarev/elixir-school/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yuriibodarev/elixir-school/labels{/name}","releases_url":"https://api.github.com/repos/yuriibodarev/elixir-school/releases{/id}","deployments_url":"https://api.github.com/repos/yuriibodarev/elixir-school/deployments","created_at":"2016-06-29T11:41:15Z","updated_at":"2016-06-29T11:41:17Z","pushed_at":"2016-07-20T17:50:20Z","git_url":"git://github.com/yuriibodarev/elixir-school.git","ssh_url":"git@github.com:yuriibodarev/elixir-school.git","clone_url":"https://github.com/yuriibodarev/elixir-school.git","svn_url":"https://github.com/yuriibodarev/elixir-school","homepage":"https://elixirschool.com","size":1950,"stargazers_count":0,"watchers_count":0,"language":"CSS","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":"doomspork:master","ref":"master","sha":"703714febc1a18b0d3c2b25b17bf4c14b62c9c5b","user":{"login":"doomspork","id":73386,"avatar_url":"https://avatars.githubusercontent.com/u/73386?v=3","gravatar_id":"","url":"https://api.github.com/users/doomspork","html_url":"https://github.com/doomspork","followers_url":"https://api.github.com/users/doomspork/followers","following_url":"https://api.github.com/users/doomspork/following{/other_user}","gists_url":"https://api.github.com/users/doomspork/gists{/gist_id}","starred_url":"https://api.github.com/users/doomspork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doomspork/subscriptions","organizations_url":"https://api.github.com/users/doomspork/orgs","repos_url":"https://api.github.com/users/doomspork/repos","events_url":"https://api.github.com/users/doomspork/events{/privacy}","received_events_url":"https://api.github.com/users/doomspork/received_events","type":"User","site_admin":false},"repo":{"id":36616176,"name":"elixir-school","full_name":"doomspork/elixir-school","owner":{"login":"doomspork","id":73386,"avatar_url":"https://avatars.githubusercontent.com/u/73386?v=3","gravatar_id":"","url":"https://api.github.com/users/doomspork","html_url":"https://github.com/doomspork","followers_url":"https://api.github.com/users/doomspork/followers","following_url":"https://api.github.com/users/doomspork/following{/other_user}","gists_url":"https://api.github.com/users/doomspork/gists{/gist_id}","starred_url":"https://api.github.com/users/doomspork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doomspork/subscriptions","organizations_url":"https://api.github.com/users/doomspork/orgs","repos_url":"https://api.github.com/users/doomspork/repos","events_url":"https://api.github.com/users/doomspork/events{/privacy}","received_events_url":"https://api.github.com/users/doomspork/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/doomspork/elixir-school","description":"Lessons about the Elixir programming language","fork":false,"url":"https://api.github.com/repos/doomspork/elixir-school","forks_url":"https://api.github.com/repos/doomspork/elixir-school/forks","keys_url":"https://api.github.com/repos/doomspork/elixir-school/keys{/key_id}","collaborators_url":"https://api.github.com/repos/doomspork/elixir-school/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/doomspork/elixir-school/teams","hooks_url":"https://api.github.com/repos/doomspork/elixir-school/hooks","issue_events_url":"https://api.github.com/repos/doomspork/elixir-school/issues/events{/number}","events_url":"https://api.github.com/repos/doomspork/elixir-school/events","assignees_url":"https://api.github.com/repos/doomspork/elixir-school/assignees{/user}","branches_url":"https://api.github.com/repos/doomspork/elixir-school/branches{/branch}","tags_url":"https://api.github.com/repos/doomspork/elixir-school/tags","blobs_url":"https://api.github.com/repos/doomspork/elixir-school/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/doomspork/elixir-school/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/doomspork/elixir-school/git/refs{/sha}","trees_url":"https://api.github.com/repos/doomspork/elixir-school/git/trees{/sha}","statuses_url":"https://api.github.com/repos/doomspork/elixir-school/statuses/{sha}","languages_url":"https://api.github.com/repos/doomspork/elixir-school/languages","stargazers_url":"https://api.github.com/repos/doomspork/elixir-school/stargazers","contributors_url":"https://api.github.com/repos/doomspork/elixir-school/contributors","subscribers_url":"https://api.github.com/repos/doomspork/elixir-school/subscribers","subscription_url":"https://api.github.com/repos/doomspork/elixir-school/subscription","commits_url":"https://api.github.com/repos/doomspork/elixir-school/commits{/sha}","git_commits_url":"https://api.github.com/repos/doomspork/elixir-school/git/commits{/sha}","comments_url":"https://api.github.com/repos/doomspork/elixir-school/comments{/number}","issue_comment_url":"https://api.github.com/repos/doomspork/elixir-school/issues/comments{/number}","contents_url":"https://api.github.com/repos/doomspork/elixir-school/contents/{+path}","compare_url":"https://api.github.com/repos/doomspork/elixir-school/compare/{base}...{head}","merges_url":"https://api.github.com/repos/doomspork/elixir-school/merges","archive_url":"https://api.github.com/repos/doomspork/elixir-school/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/doomspork/elixir-school/downloads","issues_url":"https://api.github.com/repos/doomspork/elixir-school/issues{/number}","pulls_url":"https://api.github.com/repos/doomspork/elixir-school/pulls{/number}","milestones_url":"https://api.github.com/repos/doomspork/elixir-school/milestones{/number}","notifications_url":"https://api.github.com/repos/doomspork/elixir-school/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/doomspork/elixir-school/labels{/name}","releases_url":"https://api.github.com/repos/doomspork/elixir-school/releases{/id}","deployments_url":"https://api.github.com/repos/doomspork/elixir-school/deployments","created_at":"2015-05-31T18:27:42Z","updated_at":"2016-07-20T02:47:12Z","pushed_at":"2016-07-20T17:53:59Z","git_url":"git://github.com/doomspork/elixir-school.git","ssh_url":"git@github.com:doomspork/elixir-school.git","clone_url":"https://github.com/doomspork/elixir-school.git","svn_url":"https://github.com/doomspork/elixir-school","homepage":"https://elixirschool.com","size":2782,"stargazers_count":553,"watchers_count":553,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":186,"mirror_url":null,"open_issues_count":46,"forks":186,"open_issues":46,"watchers":553,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/doomspork/elixir-school/pulls/542"},"html":{"href":"https://github.com/doomspork/elixir-school/pull/542"},"issue":{"href":"https://api.github.com/repos/doomspork/elixir-school/issues/542"},"comments":{"href":"https://api.github.com/repos/doomspork/elixir-school/issues/542/comments"},"review_comments":{"href":"https://api.github.com/repos/doomspork/elixir-school/pulls/542/comments"},"review_comment":{"href":"https://api.github.com/repos/doomspork/elixir-school/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/doomspork/elixir-school/pulls/542/commits"},"statuses":{"href":"https://api.github.com/repos/doomspork/elixir-school/statuses/cdca7ea9452930c5ce783f1ab14eae0c49b7c4fa"}}}}
{"actor":{"display_login":"brain-geek"}}