You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

133 lines
4.8 KiB

  1. [![build status](https://secure.travis-ci.org/senchalabs/connect.png)](http://travis-ci.org/senchalabs/connect)
  2. # Connect
  3. Connect is an extensible HTTP server framework for [node](http://nodejs.org), providing high performance "plugins" known as _middleware_.
  4. Connect is bundled with over _20_ commonly used middleware, including
  5. a logger, session support, cookie parser, and [more](http://senchalabs.github.com/connect). Be sure to view the 2.x [documentation](http://senchalabs.github.com/connect/).
  6. ```js
  7. var connect = require('connect')
  8. , http = require('http');
  9. var app = connect()
  10. .use(connect.favicon())
  11. .use(connect.logger('dev'))
  12. .use(connect.static('public'))
  13. .use(connect.directory('public'))
  14. .use(connect.cookieParser())
  15. .use(connect.session({ secret: 'my secret here' }))
  16. .use(function(req, res){
  17. res.end('Hello from Connect!\n');
  18. });
  19. http.createServer(app).listen(3000);
  20. ```
  21. ## Middleware
  22. - [csrf](http://www.senchalabs.org/connect/csrf.html)
  23. - [basicAuth](http://www.senchalabs.org/connect/basicAuth.html)
  24. - [bodyParser](http://www.senchalabs.org/connect/bodyParser.html)
  25. - [json](http://www.senchalabs.org/connect/json.html)
  26. - [multipart](http://www.senchalabs.org/connect/multipart.html)
  27. - [urlencoded](http://www.senchalabs.org/connect/urlencoded.html)
  28. - [cookieParser](http://www.senchalabs.org/connect/cookieParser.html)
  29. - [directory](http://www.senchalabs.org/connect/directory.html)
  30. - [compress](http://www.senchalabs.org/connect/compress.html)
  31. - [errorHandler](http://www.senchalabs.org/connect/errorHandler.html)
  32. - [favicon](http://www.senchalabs.org/connect/favicon.html)
  33. - [limit](http://www.senchalabs.org/connect/limit.html)
  34. - [logger](http://www.senchalabs.org/connect/logger.html)
  35. - [methodOverride](http://www.senchalabs.org/connect/methodOverride.html)
  36. - [query](http://www.senchalabs.org/connect/query.html)
  37. - [responseTime](http://www.senchalabs.org/connect/responseTime.html)
  38. - [session](http://www.senchalabs.org/connect/session.html)
  39. - [static](http://www.senchalabs.org/connect/static.html)
  40. - [staticCache](http://www.senchalabs.org/connect/staticCache.html)
  41. - [vhost](http://www.senchalabs.org/connect/vhost.html)
  42. - [subdomains](http://www.senchalabs.org/connect/subdomains.html)
  43. - [cookieSession](http://www.senchalabs.org/connect/cookieSession.html)
  44. ## Running Tests
  45. first:
  46. $ npm install -d
  47. then:
  48. $ make test
  49. ## Authors
  50. Below is the output from [git-summary](http://github.com/visionmedia/git-extras).
  51. project: connect
  52. commits: 2033
  53. active : 301 days
  54. files : 171
  55. authors:
  56. 1414 Tj Holowaychuk 69.6%
  57. 298 visionmedia 14.7%
  58. 191 Tim Caswell 9.4%
  59. 51 TJ Holowaychuk 2.5%
  60. 10 Ryan Olds 0.5%
  61. 8 Astro 0.4%
  62. 5 Nathan Rajlich 0.2%
  63. 5 Jakub Nešetřil 0.2%
  64. 3 Daniel Dickison 0.1%
  65. 3 David Rio Deiros 0.1%
  66. 3 Alexander Simmerl 0.1%
  67. 3 Andreas Lind Petersen 0.1%
  68. 2 Aaron Heckmann 0.1%
  69. 2 Jacques Crocker 0.1%
  70. 2 Fabian Jakobs 0.1%
  71. 2 Brian J Brennan 0.1%
  72. 2 Adam Malcontenti-Wilson 0.1%
  73. 2 Glen Mailer 0.1%
  74. 2 James Campos 0.1%
  75. 1 Trent Mick 0.0%
  76. 1 Troy Kruthoff 0.0%
  77. 1 Wei Zhu 0.0%
  78. 1 comerc 0.0%
  79. 1 darobin 0.0%
  80. 1 nateps 0.0%
  81. 1 Marco Sanson 0.0%
  82. 1 Arthur Taylor 0.0%
  83. 1 Aseem Kishore 0.0%
  84. 1 Bart Teeuwisse 0.0%
  85. 1 Cameron Howey 0.0%
  86. 1 Chad Weider 0.0%
  87. 1 Craig Barnes 0.0%
  88. 1 Eran Hammer-Lahav 0.0%
  89. 1 Gregory McWhirter 0.0%
  90. 1 Guillermo Rauch 0.0%
  91. 1 Jae Kwon 0.0%
  92. 1 Jakub Nesetril 0.0%
  93. 1 Joshua Peek 0.0%
  94. 1 Jxck 0.0%
  95. 1 AJ ONeal 0.0%
  96. 1 Michael Hemesath 0.0%
  97. 1 Morten Siebuhr 0.0%
  98. 1 Samori Gorse 0.0%
  99. 1 Tom Jensen 0.0%
  100. ## Node Compatibility
  101. Connect `< 1.x` is compatible with node 0.2.x
  102. Connect `1.x` is compatible with node 0.4.x
  103. Connect (_master_) `2.x` is compatible with node 0.6.x
  104. ## CLA
  105. [http://sencha.com/cla](http://sencha.com/cla)
  106. ## License
  107. 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/).