Skip to content
This repository has been archived by the owner on Feb 25, 2020. It is now read-only.

Commit

Permalink
references #31
Browse files Browse the repository at this point in the history
  • Loading branch information
olegp committed May 20, 2012
1 parent afdf458 commit da9eee9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The following modules are included:
* binary - [Binary/B](http://wiki.commonjs.org/wiki/Binary/B)
* io - [IO/A](http://wiki.commonjs.org/wiki/IO/A), including a `ByteArray` backed `MemoryStream`
* fs - [Filesystem/A](http://wiki.commonjs.org/wiki/Filesystem/A)
* jsgi - [JSGI 0.3](http://wiki.commonjs.org/wiki/JSGI/Level0/A/Draft2)
* httpserver - [JSGI 0.3](http://wiki.commonjs.org/wiki/JSGI/Level0/A/Draft2) compatible HTTP server
* httpclient - [HTTP Client/A](http://wiki.commonjs.org/wiki/HTTP_Client/A)
* subprocess - methods for launching subprocesses modeled after Ringo
* socket - [Sockets/A](http://wiki.commonjs.org/wiki/Sockets/A) (work in progress)
Expand Down
2 changes: 1 addition & 1 deletion lib/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//TODO include example in docs
//TODO deprecate this in favor of require(commonjs + 'fs-base');

var modules = ['assert', 'binary', 'fs-base', 'httpclient', 'io', 'jsgi',
var modules = ['assert', 'binary', 'fs-base', 'httpclient', 'io', 'httpserver',
'system', 'test', 'global', 'run', 'subprocess', 'socket'];

for( var i = 0; i < modules.length; i++) {
Expand Down
6 changes: 3 additions & 3 deletions lib/jsgi.js → lib/httpserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ var jsgi = exports.jsgi = function(app) {
};
};

var run = exports.run = function(module, port, options) {
var main = exports.main = function(module, port, options) {
var app;
if(typeof module == "function") {
app = module;
Expand All @@ -153,14 +153,14 @@ var run = exports.run = function(module, port, options) {

if (require.main === module) {
if(process.argv.length < 2) {
console.log('usage: node-fibers jsgi.js app_module [port] [key_file] [cert_file]');
console.log('usage: common-node httpserver.js app_module [port] [key_file] [cert_file]');
console.log('port defaults to 8080; if key_file and cert_file are provided, an HTTP server is started');
} else {
var options = {};
if(process.argv[4] && process.argv[5]) {
options.key = fs.readFileSync(process.argv[4]);
options.cert = fs.readFileSync(process.argv[5]);
}
run(process.argv[2], process.argv[3], options);
main(process.argv[2], process.argv[3], options);
}
}
2 changes: 1 addition & 1 deletion lib/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var run = module.exports = function(main) {
} else {
var module = require(path.resolve(process.cwd(), main || argv[1]));
if (module.app) {
require('./jsgi').run(module.app, argv[2] || 8080);
require('./httpserver').main(module.app, argv[2] || 8080);
}
}
} catch (e) {
Expand Down

0 comments on commit da9eee9

Please sign in to comment.