Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

docs

  • Loading branch information...
commit 51dde1d3276fcfa55ce71efd7e2789ee009e4175 1 parent 6747ecc
@tj tj authored
Showing with 20 additions and 6 deletions.
  1. +1 −1  docs/docs.js
  2. +3 −5 lib/index.js
  3. +16 −0 lib/proto.js
View
2  docs/docs.js
@@ -10,7 +10,7 @@ function highlight(js) {
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/\/\/(.*)/gm, '<span class="comment">//$1</span>')
- .replace(/('.*')/gm, '<span class="string">$1</span>')
+ .replace(/('.*?')/gm, '<span class="string">$1</span>')
.replace(/(\d+\.\d+)/gm, '<span class="number">$1</span>')
.replace(/(\d+)/gm, '<span class="number">$1</span>')
.replace(/\bnew *(\w+)/gm, '<span class="keyword">new</span> <span class="init">$1</span>')
View
8 lib/index.js
@@ -4,17 +4,14 @@
* shipping with over 18 bundled middleware and a rich selection of
* 3rd-party middleware.
*
- * var http = require('http');
- *
* var app = connect()
* .use(connect.logger('dev'))
* .use(connect.static('public'))
* .use(function(req, res){
* res.end('hello world\n');
- * });
+ * })
+ * .listen(3000);
*
- * http.createServer(app).listen(3000);
- *
* Installation:
*
* $ npm install connect
@@ -44,6 +41,7 @@
*
* Internals:
*
+ * - server [prototype](proto.html)
* - connect [utilities](utils.html)
* - node monkey [patches](patch.html)
*
View
16 lib/proto.js
@@ -190,6 +190,22 @@ app.handle = function(req, res, out) {
* This method takes the same arguments
* as node's `http.Server#listen()`.
*
+ * HTTP and HTTPS:
+ *
+ * If you run your application both as HTTP
+ * and HTTPS you may wrap them individually,
+ * since your Connect "server" is really just
+ * a JavaScript `Function`.
+ *
+ * var connect = require('connect')
+ * , http = require('http')
+ * , https = require('https');
+ *
+ * var app = connect();
+ *
+ * http.createServer(app).listen(80);
+ * https.createServer(options, app).listen(443);
+ *
* @return {http.Server}
* @api public
*/
Please sign in to comment.
Something went wrong with that request. Please try again.