Permalink
Browse files

going down to one port

  • Loading branch information...
1 parent 236d86e commit a19e763773fd035e5533e6b4709bc8a6b71b254c @benvanik committed Nov 6, 2011
Showing with 9 additions and 23 deletions.
  1. +2 −3 README.md
  2. +1 −2 package.json
  3. +6 −18 server.js
View
@@ -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
View
@@ -34,7 +34,6 @@
},
"devDependencies": {},
"config": {
- "api_port": "8090",
- "http_port": "8091"
+ "port": "8090"
}
}
View
@@ -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.