1 | # Connect [![Build Status](https://travis-ci.org/senchalabs/connect.svg?branch=master)](https://travis-ci.org/senchalabs/connect)
|
2 |
|
3 | Connect is an extensible HTTP server framework for [node](http://nodejs.org), providing high performance "plugins" known as _middleware_.
|
4 |
|
5 | Connect is bundled with over _20_ commonly used middleware, including
|
6 | a logger, session support, cookie parser, and [more](http://senchalabs.github.com/connect). Be sure to view the 2.x [documentation](http://www.senchalabs.org/connect/).
|
7 |
|
8 | ```js
|
9 | var connect = require('connect')
|
10 | , http = require('http');
|
11 |
|
12 | var app = connect()
|
13 | .use(connect.favicon())
|
14 | .use(connect.logger('dev'))
|
15 | .use(connect.static('public'))
|
16 | .use(connect.directory('public'))
|
17 | .use(connect.cookieParser())
|
18 | .use(connect.session({ secret: 'my secret here' }))
|
19 | .use(function(req, res){
|
20 | res.end('Hello from Connect!\n');
|
21 | });
|
22 |
|
23 | http.createServer(app).listen(3000);
|
24 | ```
|
25 |
|
26 | ## Middleware
|
27 |
|
28 | - [basicAuth](http://www.senchalabs.org/connect/basicAuth.html)
|
29 | - [bodyParser](http://www.senchalabs.org/connect/bodyParser.html)
|
30 | - [compress](http://www.senchalabs.org/connect/compress.html)
|
31 | - [cookieParser](http://www.senchalabs.org/connect/cookieParser.html)
|
32 | - [cookieSession](http://www.senchalabs.org/connect/cookieSession.html)
|
33 | - [csrf](http://www.senchalabs.org/connect/csrf.html)
|
34 | - [directory](http://www.senchalabs.org/connect/directory.html)
|
35 | - [errorHandler](http://www.senchalabs.org/connect/errorHandler.html)
|
36 | - [favicon](http://www.senchalabs.org/connect/favicon.html)
|
37 | - [json](http://www.senchalabs.org/connect/json.html)
|
38 | - [limit](http://www.senchalabs.org/connect/limit.html)
|
39 | - [logger](http://www.senchalabs.org/connect/logger.html)
|
40 | - [methodOverride](http://www.senchalabs.org/connect/methodOverride.html)
|
41 | - [multipart](http://www.senchalabs.org/connect/multipart.html)
|
42 | - [urlencoded](http://www.senchalabs.org/connect/urlencoded.html)
|
43 | - [query](http://www.senchalabs.org/connect/query.html)
|
44 | - [responseTime](http://www.senchalabs.org/connect/responseTime.html)
|
45 | - [session](http://www.senchalabs.org/connect/session.html)
|
46 | - [static](http://www.senchalabs.org/connect/static.html)
|
47 | - [staticCache](http://www.senchalabs.org/connect/staticCache.html)
|
48 | - [subdomains](http://www.senchalabs.org/connect/subdomains.html)
|
49 | - [vhost](http://www.senchalabs.org/connect/vhost.html)
|
50 |
|
51 | ## Running Tests
|
52 |
|
53 | first:
|
54 |
|
55 | $ npm install -d
|
56 |
|
57 | then:
|
58 |
|
59 | $ make test
|
60 |
|
61 | ## Contributors
|
62 |
|
63 | https://github.com/senchalabs/connect/graphs/contributors
|
64 |
|
65 | ## Node Compatibility
|
66 |
|
67 | Connect `< 1.x` is compatible with node 0.2.x
|
68 |
|
69 |
|
70 | Connect `1.x` is compatible with node 0.4.x
|
71 |
|
72 |
|
73 | Connect `2.x` is compatible with node 0.6.x
|
74 |
|
75 |
|
76 | Connect (_master_) is compatible with node 0.8.x
|
77 |
|
78 | ## CLA
|
79 |
|
80 | [http://sencha.com/cla](http://sencha.com/cla)
|
81 |
|
82 | ## License
|
83 |
|
84 | View the [LICENSE](https://github.com/senchalabs/connect/blob/master/LICENSE) file. The [Silk](http://www.famfamfam.com/lab/icons/silk/) icons used by the `directory` middleware created by/copyright of [FAMFAMFAM](http://www.famfamfam.com/).
|