Skip to content

Commit

Permalink
use figc to process command line arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
tblobaum committed Aug 9, 2012
1 parent ccf05ba commit 908c9a7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions index.js
@@ -1,17 +1,20 @@

var http = require('http')
var figc = require('figc')
, config = figc(process.cwd() + '/fleet-panel.json')
, http = require('http')
, shoe = require('shoe')
, ecstatic = require('ecstatic')(__dirname + '/public')
, dnode = require('dnode')
, server = http.createServer(ecstatic)

server.listen(process.argv[2] || 3000)
server.listen(config.port || 3000)

// if you are running fleet-panel from the
// same origin as a fleet-hub then this is not needed

var sock = shoe(function (stream) {
dnode.connect(process.argv[4] || 9000, process.argv[3] || 'localhost', function (remote, conn) {
dnode.connect({
port : config.hub.split(':')[1]
, host : config.hub.split(':')[0]
}, function (remote, conn) {
var d = dnode(remote)
d.pipe(stream).pipe(d)
})
Expand Down

0 comments on commit 908c9a7

Please sign in to comment.