{"action":"created","comment":{"url":"https://api.github.com/repos/ipfs/js-ipfs/pulls/comments/137712930","pull_request_review_id":61416121,"id":137712930,"diff_hunk":"@@ -0,0 +1,86 @@\n+'use strict'\n+\n+const filesize = require('filesize')\n+\n+const mainStyle = require('./style')\n+const pathUtil = require('../utils/path')\n+\n+function getParentDirectoryURL (originalParts) {\n+  const parts = originalParts.splice()\n+\n+  if (parts.length > 1) {\n+    parts.pop()\n+  }\n+\n+  return [ '', 'ipfs' ].concat(parts).join('/')\n+}\n+\n+function buildFilesList (path, links) {\n+  const rows = links.map((link) => {\n+    let row = [\n+      `<div class=\"ipfs-icon ipfs-_blank\">&nbsp;</div>`,\n+      `<a href=\"${pathUtil.joinURLParts(path, link.name)}\">${link.name}</a>`,\n+      filesize(link.size)\n+    ]\n+\n+    row = row.map((cell) => `<td>${cell}</td>`).join('')\n+\n+    return `<tr>${row}</tr>`\n+  })\n+\n+  return rows.join('')\n+}\n+\n+function buildTable (path, links) {\n+  const parts = pathUtil.splitPath(path)\n+  const parentDirectoryURL = getParentDirectoryURL(parts)\n+\n+  return `\n+    <table class=\"table table-striped\">\n+      <tbody>\n+        <tr>\n+          <td class=\"narrow\">\n+            <div class=\"ipfs-icon ipfs-_blank\">&nbsp;</div>\n+          </td>\n+          <td class=\"padding\">\n+            <a href=\"${parentDirectoryURL}\">..</a>\n+          </td>\n+          <td></td>\n+        </tr>\n+        ${buildFilesList(path, links)}\n+      </tbody>\n+    </table>\n+  `\n+}\n+\n+function render (path, links) {\n+  return `\n+    <!DOCTYPE html>\n+    <html>\n+    <head>\n+      <meta charset=\"utf-8\">\n+      <title>${path}</title>\n+      <style>${mainStyle}</style>\n+    </head>\n+    <body>\n+      <div id=\"header\" class=\"row\">\n+        <div class=\"col-xs-2\">\n+          <div id=\"logo\" class=\"ipfs-logo\"></div>\n+        </div>\n+      </div>\n+      <br>\n+      <div class=\"col-xs-12\">\n+        <div class=\"panel panel-default\">\n+          <div class=\"panel-heading\">\n+            <strong>Index of ${path}</strong>\n+          </div>\n+          ${buildTable(path, links)}\n+        </div>\n+      </div>\n+    </body>\n+    </html>\n+  `\n+}\n+\n+exports = module.exports","path":"src/http/gateway/dir-view/index.js","position":85,"original_position":85,"commit_id":"655a39eab122e682384bbe55471d28bab4c30c21","original_commit_id":"c4a66c24022c352e47f2f4eeac553c0f7caaf2ce","user":{"login":"diasdavid","id":1211152,"avatar_url":"https://avatars0.githubusercontent.com/u/1211152?v=4","gravatar_id":"","url":"https://api.github.com/users/diasdavid","html_url":"https://github.com/diasdavid","followers_url":"https://api.github.com/users/diasdavid/followers","following_url":"https://api.github.com/users/diasdavid/following{/other_user}","gists_url":"https://api.github.com/users/diasdavid/gists{/gist_id}","starred_url":"https://api.github.com/users/diasdavid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diasdavid/subscriptions","organizations_url":"https://api.github.com/users/diasdavid/orgs","repos_url":"https://api.github.com/users/diasdavid/repos","events_url":"https://api.github.com/users/diasdavid/events{/privacy}","received_events_url":"https://api.github.com/users/diasdavid/received_events","type":"User","site_admin":false},"body":"This can be achieved as a separate PR ","created_at":"2017-09-08T05:44:06Z","updated_at":"2017-09-08T05:44:06Z","html_url":"https://github.com/ipfs/js-ipfs/pull/968#discussion_r137712930","pull_request_url":"https://api.github.com/repos/ipfs/js-ipfs/pulls/968","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/ipfs/js-ipfs/pulls/comments/137712930"},"html":{"href":"https://github.com/ipfs/js-ipfs/pull/968#discussion_r137712930"},"pull_request":{"href":"https://api.github.com/repos/ipfs/js-ipfs/pulls/968"}},"in_reply_to_id":137468807},"pull_request":{"url":"https://api.github.com/repos/ipfs/js-ipfs/pulls/968","id":138114469,"html_url":"https://github.com/ipfs/js-ipfs/pull/968","diff_url":"https://github.com/ipfs/js-ipfs/pull/968.diff","patch_url":"https://github.com/ipfs/js-ipfs/pull/968.patch","issue_url":"https://api.github.com/repos/ipfs/js-ipfs/issues/968","number":968,"state":"open","locked":false,"title":"feat: add gateway route to daemon","user":{"login":"diasdavid","id":1211152,"avatar_url":"https://avatars0.githubusercontent.com/u/1211152?v=4","gravatar_id":"","url":"https://api.github.com/users/diasdavid","html_url":"https://github.com/diasdavid","followers_url":"https://api.github.com/users/diasdavid/followers","following_url":"https://api.github.com/users/diasdavid/following{/other_user}","gists_url":"https://api.github.com/users/diasdavid/gists{/gist_id}","starred_url":"https://api.github.com/users/diasdavid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diasdavid/subscriptions","organizations_url":"https://api.github.com/users/diasdavid/orgs","repos_url":"https://api.github.com/users/diasdavid/repos","events_url":"https://api.github.com/users/diasdavid/events{/privacy}","received_events_url":"https://api.github.com/users/diasdavid/received_events","type":"User","site_admin":false},"body":"@ya7ya @harshjv","created_at":"2017-08-29T08:09:41Z","updated_at":"2017-09-08T05:44:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d5112c793da81c7141a73464851c37cb4ee0956e","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/ipfs/js-ipfs/pulls/968/commits","review_comments_url":"https://api.github.com/repos/ipfs/js-ipfs/pulls/968/comments","review_comment_url":"https://api.github.com/repos/ipfs/js-ipfs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ipfs/js-ipfs/issues/968/comments","statuses_url":"https://api.github.com/repos/ipfs/js-ipfs/statuses/655a39eab122e682384bbe55471d28bab4c30c21","head":{"label":"ipfs:feat/gateway","ref":"feat/gateway","sha":"655a39eab122e682384bbe55471d28bab4c30c21","user":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars0.githubusercontent.com/u/10536621?v=4","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"repo":{"id":20312497,"name":"js-ipfs","full_name":"ipfs/js-ipfs","owner":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars0.githubusercontent.com/u/10536621?v=4","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ipfs/js-ipfs","description":"IPFS implementation in JavaScript","fork":false,"url":"https://api.github.com/repos/ipfs/js-ipfs","forks_url":"https://api.github.com/repos/ipfs/js-ipfs/forks","keys_url":"https://api.github.com/repos/ipfs/js-ipfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ipfs/js-ipfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ipfs/js-ipfs/teams","hooks_url":"https://api.github.com/repos/ipfs/js-ipfs/hooks","issue_events_url":"https://api.github.com/repos/ipfs/js-ipfs/issues/events{/number}","events_url":"https://api.github.com/repos/ipfs/js-ipfs/events","assignees_url":"https://api.github.com/repos/ipfs/js-ipfs/assignees{/user}","branches_url":"https://api.github.com/repos/ipfs/js-ipfs/branches{/branch}","tags_url":"https://api.github.com/repos/ipfs/js-ipfs/tags","blobs_url":"https://api.github.com/repos/ipfs/js-ipfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ipfs/js-ipfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ipfs/js-ipfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/ipfs/js-ipfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ipfs/js-ipfs/statuses/{sha}","languages_url":"https://api.github.com/repos/ipfs/js-ipfs/languages","stargazers_url":"https://api.github.com/repos/ipfs/js-ipfs/stargazers","contributors_url":"https://api.github.com/repos/ipfs/js-ipfs/contributors","subscribers_url":"https://api.github.com/repos/ipfs/js-ipfs/subscribers","subscription_url":"https://api.github.com/repos/ipfs/js-ipfs/subscription","commits_url":"https://api.github.com/repos/ipfs/js-ipfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/ipfs/js-ipfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/ipfs/js-ipfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/ipfs/js-ipfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/ipfs/js-ipfs/contents/{+path}","compare_url":"https://api.github.com/repos/ipfs/js-ipfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ipfs/js-ipfs/merges","archive_url":"https://api.github.com/repos/ipfs/js-ipfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ipfs/js-ipfs/downloads","issues_url":"https://api.github.com/repos/ipfs/js-ipfs/issues{/number}","pulls_url":"https://api.github.com/repos/ipfs/js-ipfs/pulls{/number}","milestones_url":"https://api.github.com/repos/ipfs/js-ipfs/milestones{/number}","notifications_url":"https://api.github.com/repos/ipfs/js-ipfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ipfs/js-ipfs/labels{/name}","releases_url":"https://api.github.com/repos/ipfs/js-ipfs/releases{/id}","deployments_url":"https://api.github.com/repos/ipfs/js-ipfs/deployments","created_at":"2014-05-30T00:31:06Z","updated_at":"2017-09-07T16:44:04Z","pushed_at":"2017-09-08T05:43:09Z","git_url":"git://github.com/ipfs/js-ipfs.git","ssh_url":"git@github.com:ipfs/js-ipfs.git","clone_url":"https://github.com/ipfs/js-ipfs.git","svn_url":"https://github.com/ipfs/js-ipfs","homepage":"https://ipfs.io","size":3644,"stargazers_count":1120,"watchers_count":1120,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":164,"mirror_url":null,"open_issues_count":62,"forks":164,"open_issues":62,"watchers":1120,"default_branch":"master"}},"base":{"label":"ipfs:master","ref":"master","sha":"d21b492c78e16f2dbd95463140abf5b79fdd2450","user":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars0.githubusercontent.com/u/10536621?v=4","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"repo":{"id":20312497,"name":"js-ipfs","full_name":"ipfs/js-ipfs","owner":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars0.githubusercontent.com/u/10536621?v=4","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ipfs/js-ipfs","description":"IPFS implementation in JavaScript","fork":false,"url":"https://api.github.com/repos/ipfs/js-ipfs","forks_url":"https://api.github.com/repos/ipfs/js-ipfs/forks","keys_url":"https://api.github.com/repos/ipfs/js-ipfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ipfs/js-ipfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ipfs/js-ipfs/teams","hooks_url":"https://api.github.com/repos/ipfs/js-ipfs/hooks","issue_events_url":"https://api.github.com/repos/ipfs/js-ipfs/issues/events{/number}","events_url":"https://api.github.com/repos/ipfs/js-ipfs/events","assignees_url":"https://api.github.com/repos/ipfs/js-ipfs/assignees{/user}","branches_url":"https://api.github.com/repos/ipfs/js-ipfs/branches{/branch}","tags_url":"https://api.github.com/repos/ipfs/js-ipfs/tags","blobs_url":"https://api.github.com/repos/ipfs/js-ipfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ipfs/js-ipfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ipfs/js-ipfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/ipfs/js-ipfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ipfs/js-ipfs/statuses/{sha}","languages_url":"https://api.github.com/repos/ipfs/js-ipfs/languages","stargazers_url":"https://api.github.com/repos/ipfs/js-ipfs/stargazers","contributors_url":"https://api.github.com/repos/ipfs/js-ipfs/contributors","subscribers_url":"https://api.github.com/repos/ipfs/js-ipfs/subscribers","subscription_url":"https://api.github.com/repos/ipfs/js-ipfs/subscription","commits_url":"https://api.github.com/repos/ipfs/js-ipfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/ipfs/js-ipfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/ipfs/js-ipfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/ipfs/js-ipfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/ipfs/js-ipfs/contents/{+path}","compare_url":"https://api.github.com/repos/ipfs/js-ipfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ipfs/js-ipfs/merges","archive_url":"https://api.github.com/repos/ipfs/js-ipfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ipfs/js-ipfs/downloads","issues_url":"https://api.github.com/repos/ipfs/js-ipfs/issues{/number}","pulls_url":"https://api.github.com/repos/ipfs/js-ipfs/pulls{/number}","milestones_url":"https://api.github.com/repos/ipfs/js-ipfs/milestones{/number}","notifications_url":"https://api.github.com/repos/ipfs/js-ipfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ipfs/js-ipfs/labels{/name}","releases_url":"https://api.github.com/repos/ipfs/js-ipfs/releases{/id}","deployments_url":"https://api.github.com/repos/ipfs/js-ipfs/deployments","created_at":"2014-05-30T00:31:06Z","updated_at":"2017-09-07T16:44:04Z","pushed_at":"2017-09-08T05:43:09Z","git_url":"git://github.com/ipfs/js-ipfs.git","ssh_url":"git@github.com:ipfs/js-ipfs.git","clone_url":"https://github.com/ipfs/js-ipfs.git","svn_url":"https://github.com/ipfs/js-ipfs","homepage":"https://ipfs.io","size":3644,"stargazers_count":1120,"watchers_count":1120,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":164,"mirror_url":null,"open_issues_count":62,"forks":164,"open_issues":62,"watchers":1120,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ipfs/js-ipfs/pulls/968"},"html":{"href":"https://github.com/ipfs/js-ipfs/pull/968"},"issue":{"href":"https://api.github.com/repos/ipfs/js-ipfs/issues/968"},"comments":{"href":"https://api.github.com/repos/ipfs/js-ipfs/issues/968/comments"},"review_comments":{"href":"https://api.github.com/repos/ipfs/js-ipfs/pulls/968/comments"},"review_comment":{"href":"https://api.github.com/repos/ipfs/js-ipfs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ipfs/js-ipfs/pulls/968/commits"},"statuses":{"href":"https://api.github.com/repos/ipfs/js-ipfs/statuses/655a39eab122e682384bbe55471d28bab4c30c21"}},"author_association":"OWNER"}}
{"actor":{"display_login":"diasdavid"}}