-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#1086) - Add selenium standalone as a dep
- Loading branch information
1 parent
83f8c43
commit 67471e6
Showing
3 changed files
with
46 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,30 @@ | ||
#!/usr/bin/env node | ||
|
||
'use strict'; | ||
|
||
var cors_proxy = require("corsproxy"); | ||
var http_proxy = require("http-proxy"); | ||
var http_server = require("http-server"); | ||
|
||
var program = require('commander'); | ||
|
||
program | ||
.option('-r, --remote [url]', 'Specify the remote couch host') | ||
.parse(process.argv); | ||
|
||
var COUCH_HOST = 'http://127.0.0.1:5984'; | ||
var HTTP_PORT = 8000; | ||
var CORS_PORT = 2020; | ||
|
||
var couchHost = program.remote || 'http://127.0.0.1:5984'; | ||
function startServers(remote) { | ||
var couchHost = remote || COUCH_HOST; | ||
http_server.createServer().listen(HTTP_PORT); | ||
cors_proxy.options = {target: couchHost}; | ||
http_proxy.createServer(cors_proxy).listen(CORS_PORT); | ||
} | ||
|
||
http_server.createServer().listen(HTTP_PORT); | ||
cors_proxy.options = {target: couchHost}; | ||
|
||
http_proxy.createServer(cors_proxy).listen(CORS_PORT); | ||
if (require.main === module) { | ||
program | ||
.option('-r, --remote [url]', 'Specify the remote couch host') | ||
.parse(process.argv); | ||
startServers(program.remote); | ||
} else { | ||
module.exports.start = startServers; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters