Skip to content

Commit

Permalink
going down to one port
Browse files Browse the repository at this point in the history
  • Loading branch information
benvanik committed Nov 6, 2011
1 parent 236d86e commit a19e763
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 23 deletions.
5 changes: 2 additions & 3 deletions README.md
Expand Up @@ -33,13 +33,12 @@ From source:

When using `npm start`, use `npm config` to change the launch options:

npm config set trampoline:api_port 8090
npm config set trampoline:http_port 8091
npm config set trampoline:port 8090
npm start trampoline

If launching directly via `trampoline`:

trampoline --api_port=8090 --http_port=8091
trampoline --port=8090

## API

Expand Down
3 changes: 1 addition & 2 deletions package.json
Expand Up @@ -34,7 +34,6 @@
},
"devDependencies": {},
"config": {
"api_port": "8090",
"http_port": "8091"
"port": "8090"
}
}
24 changes: 6 additions & 18 deletions server.js
Expand Up @@ -3,37 +3,25 @@
var util = require('util');

var opts = require('tav').set({
api_port: {
port: {
note: 'API binding port',
value: 8090
},
http_port: {
note: 'HTTP server binding port',
value: 8091
}
});

var API = require('./api').API;

var api_port =
parseInt(process.env.npm_package_config_api_port) ||
opts['api_port'] ||
var port =
parseInt(process.env.npm_package_config_port) ||
opts['port'] ||
8090;
var http_port =
parseInt(process.env.npm_package_config_http_port) ||
opts['http_port'] ||
8091;

util.puts('starting trampoline...');
util.puts(' api_port: ' + api_port);
util.puts(' http_port: ' + http_port);
util.puts(' port: ' + port);

// Setup API
var api = new API(api_port);
var api = new API(port);
api.start();

// Setup local HTTP server
// TODO: local HTTP server

util.puts('trampoline online and ready');
util.puts('');

0 comments on commit a19e763

Please sign in to comment.