Commit 51dde1d3 authored by TJ Holowaychuk's avatar TJ Holowaychuk

docs

parent 6747ecc1
......@@ -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>')
......
......@@ -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)
*
......
......@@ -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
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment