diff --git a/bin/spark b/bin/spark index 9b561d4..0e1b02f 100755 --- a/bin/spark +++ b/bin/spark @@ -1,7 +1,7 @@ #!/usr/bin/env node /*! - * Ext JS Connect + * Ext JS Spark * Copyright(c) 2010 Sencha Inc. * MIT Licensed */ @@ -48,8 +48,8 @@ var useColors = true; * Environment defaults. */ -var env = process.connectEnv = { - name: process.env.CONNECT_ENV || 'development', +var env = process.sparkEnv = { + name: process.env.SPARK_ENV || 'development', port: 3000, host: null }; @@ -76,10 +76,10 @@ var usage = '' + ' -u, --user ID|NAME Change user with setuid()\n' + ' -g, --group ID|NAME Change group with setgid()\n' + ' -v, --verbose Enable verbose output\n' - + ' -V, --version Output connect version\n' + + ' -V, --version Output spark version\n' + ' -K, --no-color Suppress colored terminal output\n' + ' -h, --help Outputy help information\n' - + ' --ENV VAL Sets the given connect environment variable\n' + + ' --ENV VAL Sets the given spark environment variable\n' ; /** diff --git a/examples/config/app.js b/examples/config/app.js index 6107fb4..595e348 100644 --- a/examples/config/app.js +++ b/examples/config/app.js @@ -6,10 +6,10 @@ var http = require('http'); /** - * `$ connect --chdir examples/config` + * `$ spark --chdir examples/config` * will auto-detect ./config.js and apply it. * - * `$ connect --config path/to/config examples/config.app` + * `$ spark --config path/to/config examples/config.app` * will load the app relative to CWD, and the given config module. * * NOTE: you can use --config several times to apply different configurations diff --git a/examples/custom-config/server.js b/examples/custom-config/server.js index 4cf4e44..41be8fd 100644 --- a/examples/custom-config/server.js +++ b/examples/custom-config/server.js @@ -4,20 +4,20 @@ */ var sys = require('sys'), - Connect = require('./../../lib/connect'); + http = require('http'); // Based on the current env name require / mixin the // additional file-based configuration. Try using // --env production -var conf = require('./config/' + process.connectEnv.name); +var conf = require('./config/' + process.sparkEnv.name); for (var key in conf) { - process.connectEnv[key] = conf[key]; + process.sparkEnv[key] = conf[key]; } -sys.log('loading config file "config/' + process.connectEnv.name + '.js"'); +sys.log('loading config file "config/' + process.sparkEnv.name + '.js"'); -module.exports = Connect.createServer(function(req, res, next){ +module.exports = http.createServer(function(req, res, next){ res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.end(sys.inspect(process.connectEnv)); + res.end(sys.inspect(process.sparkEnv)); }); \ No newline at end of file diff --git a/examples/hello-world/app.js b/examples/hello-world/app.js deleted file mode 100644 index 4ea5aeb..0000000 --- a/examples/hello-world/app.js +++ /dev/null @@ -1,9 +0,0 @@ -// Note that even though this looks like a normal node http app, it's really a -// valid connect app using the connect middleware stack. - -var Connect = require('../../lib/connect'); - -module.exports = Connect.createServer(function(req, res) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.end('Hello World'); -}); diff --git a/examples/hello-world/run.js b/examples/hello-world/run.js deleted file mode 100755 index c24bf56..0000000 --- a/examples/hello-world/run.js +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node - -require('./app').listen(8080); \ No newline at end of file diff --git a/examples/node/app.js b/examples/node/app.js index 8c14b11..eb13c74 100644 --- a/examples/node/app.js +++ b/examples/node/app.js @@ -1,11 +1,7 @@ - -/** - * Module dependencies. - */ - +// Yes, this is a vanilla node app var http = require('http'); -module.exports = require('http').createServer(function(req, res){ +module.exports = http.createServer(function(req, res){ res.writeHead(200, { 'Content-Type': 'text/plain' }); res.end(this.env.name); }); \ No newline at end of file diff --git a/examples/ssl/app.js b/examples/ssl/app.js index 0f9758d..d89d9eb 100644 --- a/examples/ssl/app.js +++ b/examples/ssl/app.js @@ -1,6 +1,6 @@ -var Connect = require('../../lib/connect'); +var http = require('http'); -module.exports = Connect.createServer(function(req, res) { +module.exports = http.createServer(function(req, res) { res.writeHead(200, { 'Content-Type': 'text/plain' }); var secure = req.socket.secure; res.end('secure=' + secure + ', that is ' + (secure ? 'good' : 'bad')); diff --git a/examples/ssl/start.js b/examples/ssl/start.js index c682876..9a6ce0a 100755 --- a/examples/ssl/start.js +++ b/examples/ssl/start.js @@ -18,4 +18,5 @@ var creds = crypto.createCredentials( }); app.setSecure(creds); -app.listen(); +app.listen(3000); +console.log("https://localhost:3000/") diff --git a/examples/ssl/start.sh b/examples/ssl/start.sh index b8c24a0..11367a5 100755 --- a/examples/ssl/start.sh +++ b/examples/ssl/start.sh @@ -2,7 +2,7 @@ # # Use ./genkeycert.sh before running! # -# Demonstrates usage of SSL support in the connect(1) binary. +# Demonstrates usage of SSL support in the executable(1) binary. # -../../bin/connect --ssl-key privatekey.pem --ssl-crt certificate.pem +../../bin/spark --ssl-key privatekey.pem --ssl-crt certificate.pem