Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update spark example to not depend on connect.

  • Loading branch information...
commit d43b6b00b0778fa50e5f343cdedb0b5d7fc08b20 1 parent 9d84e5a
@creationix creationix authored
View
10 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'
;
/**
View
4 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
View
12 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));
});
View
9 examples/hello-world/app.js
@@ -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');
-});
View
3  examples/hello-world/run.js
@@ -1,3 +0,0 @@
-#!/usr/bin/env node
-
-require('./app').listen(8080);
View
8 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);
});
View
4 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'));
View
3  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/")
View
4 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
Please sign in to comment.
Something went wrong with that request. Please try again.