{"action":"created","comment":{"url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/pulls/comments/47342349","id":47342349,"diff_hunk":"@@ -1,18 +1,27 @@\n-var env = require('./env'),\n-    resources = require('./resources');\n+var resources = require('./resources');\n+\n+var root = require('./env').root;\n \n \n var reverse = function() {","path":"src/js/router.js","position":8,"original_position":8,"commit_id":"1b59f2282c0275faaf203431937e0ed01e0d3219","original_commit_id":"1b59f2282c0275faaf203431937e0ed01e0d3219","user":{"login":"bruth","id":515142,"avatar_url":"https://avatars.githubusercontent.com/u/515142?v=3","gravatar_id":"","url":"https://api.github.com/users/bruth","html_url":"https://github.com/bruth","followers_url":"https://api.github.com/users/bruth/followers","following_url":"https://api.github.com/users/bruth/following{/other_user}","gists_url":"https://api.github.com/users/bruth/gists{/gist_id}","starred_url":"https://api.github.com/users/bruth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bruth/subscriptions","organizations_url":"https://api.github.com/users/bruth/orgs","repos_url":"https://api.github.com/users/bruth/repos","events_url":"https://api.github.com/users/bruth/events{/privacy}","received_events_url":"https://api.github.com/users/bruth/received_events","type":"User","site_admin":false},"body":"Can you write a comment about what can be accepted in this function? One of the advantages to the [original implementation](https://github.com/PEDSnet/pedsnet-catalogue/blob/29c82ae342b7b6b4ffdfdde25c8c2145948e2ae7/src/js/router.js) was that it was self-describing. Obviously accounting for all possible URLs is not feasible nor flexible, but use regexes to describe the structure would be a good start. Also, it would be simpler to evaluate and construct that path as before and at the end return it with the root prepended rather than repeating the code.","created_at":"2015-12-11T10:43:04Z","updated_at":"2015-12-11T10:43:04Z","html_url":"https://github.com/PEDSnet/pedsnet-catalogue/pull/15#discussion_r47342349","pull_request_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/pulls/comments/47342349"},"html":{"href":"https://github.com/PEDSnet/pedsnet-catalogue/pull/15#discussion_r47342349"},"pull_request":{"href":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/pulls/15","id":53320570,"html_url":"https://github.com/PEDSnet/pedsnet-catalogue/pull/15","diff_url":"https://github.com/PEDSnet/pedsnet-catalogue/pull/15.diff","patch_url":"https://github.com/PEDSnet/pedsnet-catalogue/pull/15.patch","issue_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/issues/15","number":15,"state":"open","locked":false,"title":"Fix URL prefix handling","user":{"login":"l-k-","id":6386739,"avatar_url":"https://avatars.githubusercontent.com/u/6386739?v=3","gravatar_id":"","url":"https://api.github.com/users/l-k-","html_url":"https://github.com/l-k-","followers_url":"https://api.github.com/users/l-k-/followers","following_url":"https://api.github.com/users/l-k-/following{/other_user}","gists_url":"https://api.github.com/users/l-k-/gists{/gist_id}","starred_url":"https://api.github.com/users/l-k-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/l-k-/subscriptions","organizations_url":"https://api.github.com/users/l-k-/orgs","repos_url":"https://api.github.com/users/l-k-/repos","events_url":"https://api.github.com/users/l-k-/events{/privacy}","received_events_url":"https://api.github.com/users/l-k-/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-10T21:36:32Z","updated_at":"2015-12-11T10:43:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"28e73bcfd412427c31547f6d881862522ddda7bb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/pulls/15/commits","review_comments_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/pulls/15/comments","review_comment_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/issues/15/comments","statuses_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/statuses/1b59f2282c0275faaf203431937e0ed01e0d3219","head":{"label":"l-k-:master","ref":"master","sha":"1b59f2282c0275faaf203431937e0ed01e0d3219","user":{"login":"l-k-","id":6386739,"avatar_url":"https://avatars.githubusercontent.com/u/6386739?v=3","gravatar_id":"","url":"https://api.github.com/users/l-k-","html_url":"https://github.com/l-k-","followers_url":"https://api.github.com/users/l-k-/followers","following_url":"https://api.github.com/users/l-k-/following{/other_user}","gists_url":"https://api.github.com/users/l-k-/gists{/gist_id}","starred_url":"https://api.github.com/users/l-k-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/l-k-/subscriptions","organizations_url":"https://api.github.com/users/l-k-/orgs","repos_url":"https://api.github.com/users/l-k-/repos","events_url":"https://api.github.com/users/l-k-/events{/privacy}","received_events_url":"https://api.github.com/users/l-k-/received_events","type":"User","site_admin":false},"repo":{"id":47785395,"name":"pedsnet-catalogue","full_name":"l-k-/pedsnet-catalogue","owner":{"login":"l-k-","id":6386739,"avatar_url":"https://avatars.githubusercontent.com/u/6386739?v=3","gravatar_id":"","url":"https://api.github.com/users/l-k-","html_url":"https://github.com/l-k-","followers_url":"https://api.github.com/users/l-k-/followers","following_url":"https://api.github.com/users/l-k-/following{/other_user}","gists_url":"https://api.github.com/users/l-k-/gists{/gist_id}","starred_url":"https://api.github.com/users/l-k-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/l-k-/subscriptions","organizations_url":"https://api.github.com/users/l-k-/orgs","repos_url":"https://api.github.com/users/l-k-/repos","events_url":"https://api.github.com/users/l-k-/events{/privacy}","received_events_url":"https://api.github.com/users/l-k-/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/l-k-/pedsnet-catalogue","description":"Integrated view of PEDSnet.","fork":true,"url":"https://api.github.com/repos/l-k-/pedsnet-catalogue","forks_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/forks","keys_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/keys{/key_id}","collaborators_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/teams","hooks_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/hooks","issue_events_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/issues/events{/number}","events_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/events","assignees_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/assignees{/user}","branches_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/branches{/branch}","tags_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/tags","blobs_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/git/refs{/sha}","trees_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/git/trees{/sha}","statuses_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/statuses/{sha}","languages_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/languages","stargazers_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/stargazers","contributors_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/contributors","subscribers_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/subscribers","subscription_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/subscription","commits_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/commits{/sha}","git_commits_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/git/commits{/sha}","comments_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/comments{/number}","issue_comment_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/issues/comments{/number}","contents_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/contents/{+path}","compare_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/compare/{base}...{head}","merges_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/merges","archive_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/downloads","issues_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/issues{/number}","pulls_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/pulls{/number}","milestones_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/milestones{/number}","notifications_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/labels{/name}","releases_url":"https://api.github.com/repos/l-k-/pedsnet-catalogue/releases{/id}","created_at":"2015-12-10T20:22:59Z","updated_at":"2015-12-10T20:23:00Z","pushed_at":"2015-12-10T21:15:53Z","git_url":"git://github.com/l-k-/pedsnet-catalogue.git","ssh_url":"git@github.com:l-k-/pedsnet-catalogue.git","clone_url":"https://github.com/l-k-/pedsnet-catalogue.git","svn_url":"https://github.com/l-k-/pedsnet-catalogue","homepage":"","size":100,"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":"PEDSnet:master","ref":"master","sha":"fdcc46735a3c73e507fe9e3ea64cdcb65b173f5d","user":{"login":"PEDSnet","id":7228066,"avatar_url":"https://avatars.githubusercontent.com/u/7228066?v=3","gravatar_id":"","url":"https://api.github.com/users/PEDSnet","html_url":"https://github.com/PEDSnet","followers_url":"https://api.github.com/users/PEDSnet/followers","following_url":"https://api.github.com/users/PEDSnet/following{/other_user}","gists_url":"https://api.github.com/users/PEDSnet/gists{/gist_id}","starred_url":"https://api.github.com/users/PEDSnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PEDSnet/subscriptions","organizations_url":"https://api.github.com/users/PEDSnet/orgs","repos_url":"https://api.github.com/users/PEDSnet/repos","events_url":"https://api.github.com/users/PEDSnet/events{/privacy}","received_events_url":"https://api.github.com/users/PEDSnet/received_events","type":"Organization","site_admin":false},"repo":{"id":41030153,"name":"pedsnet-catalogue","full_name":"PEDSnet/pedsnet-catalogue","owner":{"login":"PEDSnet","id":7228066,"avatar_url":"https://avatars.githubusercontent.com/u/7228066?v=3","gravatar_id":"","url":"https://api.github.com/users/PEDSnet","html_url":"https://github.com/PEDSnet","followers_url":"https://api.github.com/users/PEDSnet/followers","following_url":"https://api.github.com/users/PEDSnet/following{/other_user}","gists_url":"https://api.github.com/users/PEDSnet/gists{/gist_id}","starred_url":"https://api.github.com/users/PEDSnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PEDSnet/subscriptions","organizations_url":"https://api.github.com/users/PEDSnet/orgs","repos_url":"https://api.github.com/users/PEDSnet/repos","events_url":"https://api.github.com/users/PEDSnet/events{/privacy}","received_events_url":"https://api.github.com/users/PEDSnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PEDSnet/pedsnet-catalogue","description":"Integrated view of PEDSnet.","fork":false,"url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue","forks_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/forks","keys_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/teams","hooks_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/hooks","issue_events_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/issues/events{/number}","events_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/events","assignees_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/assignees{/user}","branches_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/branches{/branch}","tags_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/tags","blobs_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/git/refs{/sha}","trees_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/statuses/{sha}","languages_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/languages","stargazers_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/stargazers","contributors_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/contributors","subscribers_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/subscribers","subscription_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/subscription","commits_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/commits{/sha}","git_commits_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/git/commits{/sha}","comments_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/comments{/number}","issue_comment_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/issues/comments{/number}","contents_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/contents/{+path}","compare_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/merges","archive_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/downloads","issues_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/issues{/number}","pulls_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/pulls{/number}","milestones_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/milestones{/number}","notifications_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/labels{/name}","releases_url":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/releases{/id}","created_at":"2015-08-19T11:30:36Z","updated_at":"2015-10-13T11:26:32Z","pushed_at":"2015-12-10T21:36:32Z","git_url":"git://github.com/PEDSnet/pedsnet-catalogue.git","ssh_url":"git@github.com:PEDSnet/pedsnet-catalogue.git","clone_url":"https://github.com/PEDSnet/pedsnet-catalogue.git","svn_url":"https://github.com/PEDSnet/pedsnet-catalogue","homepage":"","size":108,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/pulls/15"},"html":{"href":"https://github.com/PEDSnet/pedsnet-catalogue/pull/15"},"issue":{"href":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/issues/15"},"comments":{"href":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/PEDSnet/pedsnet-catalogue/statuses/1b59f2282c0275faaf203431937e0ed01e0d3219"}}}}