{"action":"created","comment":{"url":"https://api.github.com/repos/aframevr-userland/aframe-cli/pulls/comments/125101540","pull_request_review_id":47462976,"id":125101540,"diff_hunk":"@@ -13,14 +17,56 @@ const serve = (watchPath, options) => new Promise((resolve, reject) => {\n   options.config = options.config || getBrunchConfigPath(watchPath, options);\n   options.server = true;\n   options.network = true;\n+\n+  const optionsFile = require(options.config);\n+\n   logger.log(`Watching \"${watchPath}\" …`);\n \n   // Copy the server URL to the user's clipboard.\n-  const port = options.port || 3333;\n+  const port = (optionsFile.server && optionsFile.server.port) || 3333;\n   const https = options.https || options.ssl || options.secure || false;\n   const serverUrl = `http${https ? 's' : ''}://localhost:${port}/`;\n   try {\n-    return brunch.watch(options, () => {\n+    const watcher = brunch.watch(options, () => {\n+      // saves preview videos from recorder component.\n+      watcher.server.on('request', function (req, res) {\n+        const method = req.method.toLowerCase();\n+        const pathname = url.parse(req.url).pathname;\n+\n+        if (method === 'post' && pathname === '/upload') {\n+          let form = new formidable.IncomingForm();\n+          let formData = {};\n+          let files = [];\n+\n+          form.encoding = 'binary';\n+          form.keepExtensions = true;\n+          form.multiple = true;\n+\n+          var uploadDir = path.join(watchPath, 'app/assets/video/');","path":"lib/serve.js","position":45,"original_position":45,"commit_id":"2d3fe368c41e9c209f7d7752417d6c7bbc570918","original_commit_id":"2d3fe368c41e9c209f7d7752417d6c7bbc570918","user":{"login":"cvan","id":203725,"avatar_url":"https://avatars3.githubusercontent.com/u/203725?v=3","gravatar_id":"","url":"https://api.github.com/users/cvan","html_url":"https://github.com/cvan","followers_url":"https://api.github.com/users/cvan/followers","following_url":"https://api.github.com/users/cvan/following{/other_user}","gists_url":"https://api.github.com/users/cvan/gists{/gist_id}","starred_url":"https://api.github.com/users/cvan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvan/subscriptions","organizations_url":"https://api.github.com/users/cvan/orgs","repos_url":"https://api.github.com/users/cvan/repos","events_url":"https://api.github.com/users/cvan/events{/privacy}","received_events_url":"https://api.github.com/users/cvan/received_events","type":"User","site_admin":false},"body":"can make this a `const`","created_at":"2017-06-30T18:23:33Z","updated_at":"2017-06-30T18:25:03Z","html_url":"https://github.com/aframevr-userland/aframe-cli/pull/52#discussion_r125101540","pull_request_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/pulls/52","_links":{"self":{"href":"https://api.github.com/repos/aframevr-userland/aframe-cli/pulls/comments/125101540"},"html":{"href":"https://github.com/aframevr-userland/aframe-cli/pull/52#discussion_r125101540"},"pull_request":{"href":"https://api.github.com/repos/aframevr-userland/aframe-cli/pulls/52"}}},"pull_request":{"url":"https://api.github.com/repos/aframevr-userland/aframe-cli/pulls/52","id":128283052,"html_url":"https://github.com/aframevr-userland/aframe-cli/pull/52","diff_url":"https://github.com/aframevr-userland/aframe-cli/pull/52.diff","patch_url":"https://github.com/aframevr-userland/aframe-cli/pull/52.patch","issue_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/issues/52","number":52,"state":"open","locked":false,"title":"handles file posts from recorder.","user":{"login":"caseyyee","id":1560884,"avatar_url":"https://avatars0.githubusercontent.com/u/1560884?v=3","gravatar_id":"","url":"https://api.github.com/users/caseyyee","html_url":"https://github.com/caseyyee","followers_url":"https://api.github.com/users/caseyyee/followers","following_url":"https://api.github.com/users/caseyyee/following{/other_user}","gists_url":"https://api.github.com/users/caseyyee/gists{/gist_id}","starred_url":"https://api.github.com/users/caseyyee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caseyyee/subscriptions","organizations_url":"https://api.github.com/users/caseyyee/orgs","repos_url":"https://api.github.com/users/caseyyee/repos","events_url":"https://api.github.com/users/caseyyee/events{/privacy}","received_events_url":"https://api.github.com/users/caseyyee/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-06-30T02:10:52Z","updated_at":"2017-06-30T18:25:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f73c3abbe55a79aaa1c923e44908867fe6082a01","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/pulls/52/commits","review_comments_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/pulls/52/comments","review_comment_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/issues/52/comments","statuses_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/statuses/2d3fe368c41e9c209f7d7752417d6c7bbc570918","head":{"label":"caseyyee:upload","ref":"upload","sha":"2d3fe368c41e9c209f7d7752417d6c7bbc570918","user":{"login":"caseyyee","id":1560884,"avatar_url":"https://avatars0.githubusercontent.com/u/1560884?v=3","gravatar_id":"","url":"https://api.github.com/users/caseyyee","html_url":"https://github.com/caseyyee","followers_url":"https://api.github.com/users/caseyyee/followers","following_url":"https://api.github.com/users/caseyyee/following{/other_user}","gists_url":"https://api.github.com/users/caseyyee/gists{/gist_id}","starred_url":"https://api.github.com/users/caseyyee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caseyyee/subscriptions","organizations_url":"https://api.github.com/users/caseyyee/orgs","repos_url":"https://api.github.com/users/caseyyee/repos","events_url":"https://api.github.com/users/caseyyee/events{/privacy}","received_events_url":"https://api.github.com/users/caseyyee/received_events","type":"User","site_admin":false},"repo":{"id":92714548,"name":"aframe-cli","full_name":"caseyyee/aframe-cli","owner":{"login":"caseyyee","id":1560884,"avatar_url":"https://avatars0.githubusercontent.com/u/1560884?v=3","gravatar_id":"","url":"https://api.github.com/users/caseyyee","html_url":"https://github.com/caseyyee","followers_url":"https://api.github.com/users/caseyyee/followers","following_url":"https://api.github.com/users/caseyyee/following{/other_user}","gists_url":"https://api.github.com/users/caseyyee/gists{/gist_id}","starred_url":"https://api.github.com/users/caseyyee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caseyyee/subscriptions","organizations_url":"https://api.github.com/users/caseyyee/orgs","repos_url":"https://api.github.com/users/caseyyee/repos","events_url":"https://api.github.com/users/caseyyee/events{/privacy}","received_events_url":"https://api.github.com/users/caseyyee/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/caseyyee/aframe-cli","description":"💻 A command-line tool for building :a: A-Frame scenes. — ⚠ DO NOT USE. This is a WIP!","fork":true,"url":"https://api.github.com/repos/caseyyee/aframe-cli","forks_url":"https://api.github.com/repos/caseyyee/aframe-cli/forks","keys_url":"https://api.github.com/repos/caseyyee/aframe-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/caseyyee/aframe-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/caseyyee/aframe-cli/teams","hooks_url":"https://api.github.com/repos/caseyyee/aframe-cli/hooks","issue_events_url":"https://api.github.com/repos/caseyyee/aframe-cli/issues/events{/number}","events_url":"https://api.github.com/repos/caseyyee/aframe-cli/events","assignees_url":"https://api.github.com/repos/caseyyee/aframe-cli/assignees{/user}","branches_url":"https://api.github.com/repos/caseyyee/aframe-cli/branches{/branch}","tags_url":"https://api.github.com/repos/caseyyee/aframe-cli/tags","blobs_url":"https://api.github.com/repos/caseyyee/aframe-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/caseyyee/aframe-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/caseyyee/aframe-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/caseyyee/aframe-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/caseyyee/aframe-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/caseyyee/aframe-cli/languages","stargazers_url":"https://api.github.com/repos/caseyyee/aframe-cli/stargazers","contributors_url":"https://api.github.com/repos/caseyyee/aframe-cli/contributors","subscribers_url":"https://api.github.com/repos/caseyyee/aframe-cli/subscribers","subscription_url":"https://api.github.com/repos/caseyyee/aframe-cli/subscription","commits_url":"https://api.github.com/repos/caseyyee/aframe-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/caseyyee/aframe-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/caseyyee/aframe-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/caseyyee/aframe-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/caseyyee/aframe-cli/contents/{+path}","compare_url":"https://api.github.com/repos/caseyyee/aframe-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/caseyyee/aframe-cli/merges","archive_url":"https://api.github.com/repos/caseyyee/aframe-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/caseyyee/aframe-cli/downloads","issues_url":"https://api.github.com/repos/caseyyee/aframe-cli/issues{/number}","pulls_url":"https://api.github.com/repos/caseyyee/aframe-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/caseyyee/aframe-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/caseyyee/aframe-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/caseyyee/aframe-cli/labels{/name}","releases_url":"https://api.github.com/repos/caseyyee/aframe-cli/releases{/id}","deployments_url":"https://api.github.com/repos/caseyyee/aframe-cli/deployments","created_at":"2017-05-29T06:57:35Z","updated_at":"2017-05-29T06:57:37Z","pushed_at":"2017-06-30T02:09:05Z","git_url":"git://github.com/caseyyee/aframe-cli.git","ssh_url":"git@github.com:caseyyee/aframe-cli.git","clone_url":"https://github.com/caseyyee/aframe-cli.git","svn_url":"https://github.com/caseyyee/aframe-cli","homepage":"","size":9848,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"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":"aframevr-userland:master","ref":"master","sha":"7209696d1f5b32504ecef376e082d5727e19962a","user":{"login":"aframevr-userland","id":28981599,"avatar_url":"https://avatars3.githubusercontent.com/u/28981599?v=3","gravatar_id":"","url":"https://api.github.com/users/aframevr-userland","html_url":"https://github.com/aframevr-userland","followers_url":"https://api.github.com/users/aframevr-userland/followers","following_url":"https://api.github.com/users/aframevr-userland/following{/other_user}","gists_url":"https://api.github.com/users/aframevr-userland/gists{/gist_id}","starred_url":"https://api.github.com/users/aframevr-userland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aframevr-userland/subscriptions","organizations_url":"https://api.github.com/users/aframevr-userland/orgs","repos_url":"https://api.github.com/users/aframevr-userland/repos","events_url":"https://api.github.com/users/aframevr-userland/events{/privacy}","received_events_url":"https://api.github.com/users/aframevr-userland/received_events","type":"Organization","site_admin":false},"repo":{"id":92387016,"name":"aframe-cli","full_name":"aframevr-userland/aframe-cli","owner":{"login":"aframevr-userland","id":28981599,"avatar_url":"https://avatars3.githubusercontent.com/u/28981599?v=3","gravatar_id":"","url":"https://api.github.com/users/aframevr-userland","html_url":"https://github.com/aframevr-userland","followers_url":"https://api.github.com/users/aframevr-userland/followers","following_url":"https://api.github.com/users/aframevr-userland/following{/other_user}","gists_url":"https://api.github.com/users/aframevr-userland/gists{/gist_id}","starred_url":"https://api.github.com/users/aframevr-userland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aframevr-userland/subscriptions","organizations_url":"https://api.github.com/users/aframevr-userland/orgs","repos_url":"https://api.github.com/users/aframevr-userland/repos","events_url":"https://api.github.com/users/aframevr-userland/events{/privacy}","received_events_url":"https://api.github.com/users/aframevr-userland/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aframevr-userland/aframe-cli","description":"💻 A command-line tool for building :a: A-Frame WebVR scenes.","fork":false,"url":"https://api.github.com/repos/aframevr-userland/aframe-cli","forks_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/forks","keys_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/teams","hooks_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/hooks","issue_events_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/issues/events{/number}","events_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/events","assignees_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/assignees{/user}","branches_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/branches{/branch}","tags_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/tags","blobs_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/languages","stargazers_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/stargazers","contributors_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/contributors","subscribers_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/subscribers","subscription_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/subscription","commits_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/contents/{+path}","compare_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/merges","archive_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/downloads","issues_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/issues{/number}","pulls_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/labels{/name}","releases_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/releases{/id}","deployments_url":"https://api.github.com/repos/aframevr-userland/aframe-cli/deployments","created_at":"2017-05-25T09:22:58Z","updated_at":"2017-06-22T17:27:05Z","pushed_at":"2017-06-30T02:20:16Z","git_url":"git://github.com/aframevr-userland/aframe-cli.git","ssh_url":"git@github.com:aframevr-userland/aframe-cli.git","clone_url":"https://github.com/aframevr-userland/aframe-cli.git","svn_url":"https://github.com/aframevr-userland/aframe-cli","homepage":"","size":9864,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":32,"forks":2,"open_issues":32,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aframevr-userland/aframe-cli/pulls/52"},"html":{"href":"https://github.com/aframevr-userland/aframe-cli/pull/52"},"issue":{"href":"https://api.github.com/repos/aframevr-userland/aframe-cli/issues/52"},"comments":{"href":"https://api.github.com/repos/aframevr-userland/aframe-cli/issues/52/comments"},"review_comments":{"href":"https://api.github.com/repos/aframevr-userland/aframe-cli/pulls/52/comments"},"review_comment":{"href":"https://api.github.com/repos/aframevr-userland/aframe-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aframevr-userland/aframe-cli/pulls/52/commits"},"statuses":{"href":"https://api.github.com/repos/aframevr-userland/aframe-cli/statuses/2d3fe368c41e9c209f7d7752417d6c7bbc570918"}}}}
{"actor":{"display_login":"cvan"}}