Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

references #31

  • Loading branch information...
commit da9eee90ae191a704b0c4327634daf8cdcdb281d 1 parent afdf458
@olegp authored
View
2  README.md
@@ -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)
View
2  lib/all.js
@@ -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++) {
View
6 lib/jsgi.js → lib/httpserver.js
@@ -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;
@@ -153,7 +153,7 @@ 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 = {};
@@ -161,6 +161,6 @@ if (require.main === module) {
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);
}
}
View
2  lib/run.js
@@ -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) {
Please sign in to comment.
Something went wrong with that request. Please try again.