Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 137 lines (98 sloc) 4.492 kb
8675f12 @tj New doc files
tj authored
1
bf03e85 @tj No more ASCII art
tj authored
2 # Express
3
8675f12 @tj New doc files
tj authored
4 Insanely fast (and small) server-side JavaScript web development framework
9f06b11 @tj Docs
tj authored
5 built on **node.js** and the **V8 JavaScript engine**.
8675f12 @tj New doc files
tj authored
6
ec00ccb @tj Added Google Groups link
tj authored
7 * Visit the [Wiki](http://wiki.github.com/visionmedia/express) for documentation
8 * Visit the [Google Group](http://groups.google.com/group/express-js) for discussion
8675f12 @tj New doc files
tj authored
9
fa08323 @tj Markdown
tj authored
10 ## Features (so far)
8675f12 @tj New doc files
tj authored
11
64a4741 @tj Updated features
tj authored
12 * Sexy DSL with robust sinatra-like routing
13 * High performance
8675f12 @tj New doc files
tj authored
14 * Mime helpers
f0f71cc @tj Docs
tj authored
15 * Redirection helpers
8675f12 @tj New doc files
tj authored
16 * Nested parameter parsing
17 * Full test coverage
64a4741 @tj Updated features
tj authored
18 * Extremely readable specs
8675f12 @tj New doc files
tj authored
19 * Test helpers (mock requests etc)
64a4741 @tj Updated features
tj authored
20 * Environment based configuration
21 * Light-weight JavaScript class implementation via js-oo
460c2a0 @tj Collection readme
tj authored
22 * Collections and chainable iterators
08ada90 @tj Docs
tj authored
23 * ElementCollections / markup parsing via libxmljs and css selector traversal support via css2xpath
7d36c6a @tj Added haml to list of supported template engines
tj authored
24 * View support (ejs, haml, mustache)
bbb858e @tj Added install section in readme
tj authored
25
26 ## Installation
27
28 Currently Express must be cloned (or downloaded), you can use the following command to
29 get rolling and initialize the submodule dependencies:
30
31 $ git clone git://github.com/visionmedia/express.git && cd express && git submodule update --init && make app
3703179 @tj Added gh install section
tj authored
32
33 Or with the [gh](http://github.com/visionmedia/gh) utility:
34
35 $ gh clone visionmedia express && cd express && git submodule update --init && make app
9973bd7 @nomiddlename Added example, extra info to Readme
nomiddlename authored
36
fa08323 @tj Markdown
tj authored
37 ## Performance
cc5983f @tj Performance docs
tj authored
38
39 Extensive benchmarking will wait until a development version
9181f7d @tj New benchmarks with 2 haml views
tj authored
40 has been released.
cdaca71 @tj Updated benchmarking
tj authored
41
73efcb5 @tj Readme formatting
tj authored
42 Currently Express can chew through a request with a two Haml views (*page and layout*)
43 requested **2000** times with concurrency of **80** in **2.4** seconds and **814**
4bbda07 @tj NOTE: benchmarks implemented no caching
tj authored
44 requests per second. With no caching involved.
9181f7d @tj New benchmarks with 2 haml views
tj authored
45
73efcb5 @tj Readme formatting
tj authored
46 An identical Sinatra application was served with the **Thin** HTTP server
47 and scored **8.3** seconds and **238** requests per second. In this situation
c5491c9 @tj Benchmarks
tj authored
48 Express is currently **3.5** times faster than Sinatra.
8675f12 @tj New doc files
tj authored
49
fa08323 @tj Markdown
tj authored
50 ## Examples
8675f12 @tj New doc files
tj authored
51
74e0231 @tj Better app example in readme
tj authored
52 require.paths.unshift('lib')
9b8d417 @tj Docs
tj authored
53 require('express')
54 require('express/plugins')
55
74e0231 @tj Better app example in readme
tj authored
56 configure(function(){
57 use(MethodOverride)
58 use(ContentLength)
59 use(Redirect)
60 set('root', dirname(__filename))
61 enable('cache views')
62 })
63
64 get('/hello', function(){
0bdff0f @tj Fixed example app in readme
tj authored
65 this.contentType('html')
74e0231 @tj Better app example in readme
tj authored
66 return '<h1>World<h1>'
67 })
9b8d417 @tj Docs
tj authored
68
74e0231 @tj Better app example in readme
tj authored
69 get('/user/:id?', function(id) {
0bdff0f @tj Fixed example app in readme
tj authored
70 this.render('user.haml.html', {
74e0231 @tj Better app example in readme
tj authored
71 locals: {
72 name: id ? 'User ' + id : 'You'
73 }
74 })
9b8d417 @tj Docs
tj authored
75 })
76
77 run()
7807f42 @tj Added POST urlencoded body parsing
tj authored
78
34a55ba @tj Readme for testing
tj authored
79 ## Running Tests
80
81 Express uses the [JSpec](http://jspec.info) BDD JavaScript testing
82 framework to write and run elegant spec suites. JSpec is froozen
83 to spec/lib and does not require seperate installation.
fa08323 @tj Markdown
tj authored
84
8e23ebb @tj Updated readme with new spec running info
tj authored
85 To run all specifications:
fa08323 @tj Markdown
tj authored
86
8e23ebb @tj Updated readme with new spec running info
tj authored
87 $ make test
fde2bfc @tj Link to Mojo mustache templates
tj authored
88
8e23ebb @tj Updated readme with new spec running info
tj authored
89 Run individual suites:
7459e7d @nomiddlename Amended readme for running individual specs
nomiddlename authored
90
91 $ node spec/spec.node.js core
8e23ebb @tj Updated readme with new spec running info
tj authored
92 $ node spec/spec.node.js mime
93 $ node spec/spec.node.js routing
94 ...
19672e7 @tj Arch warning for testing binaries
tj authored
95
96 Runnning libxmljs related specs, if you have an architecture issue
97 then you will need to rebuild _spec/support/libxmljs.node_.
9df1a1b @tj Added node dev version to readme
tj authored
98
99 Express is currently being developed with node --version:
dd5d4cc @tj Added encoding param to Request#halt() and Request#respond()
tj authored
100 v0.1.21-66-g59a78d6
7459e7d @nomiddlename Amended readme for running individual specs
nomiddlename authored
101
881c63c @tj Added ext.js link
tj authored
102 ## More Information
103
104 * [JavaScript Extensions &amp; Utilities](http://github.com/visionmedia/ext.js)
2c92405 @tj Added Sass.js link
tj authored
105 * [JavaScript Sass](http://github.com/visionmedia/sass.js)
881c63c @tj Added ext.js link
tj authored
106
3777bfd @tj Added contributor list
tj authored
107 ## Contributors
108
881c63c @tj Added ext.js link
tj authored
109 * TJ Holowaychuk (visionmedia) &lt;tj@vision-media.ca&gt;
110 * Ciaran Jessup (ciaranj) &lt;ciaranj@gmail.com&gt;
17c4168 @tj Added Gareth to contrib list
tj authored
111 * Gareth Jones (csausdev) &lt;gareth.jones@sensis.com.au&gt;
3777bfd @tj Added contributor list
tj authored
112
fa08323 @tj Markdown
tj authored
113 ## License
8675f12 @tj New doc files
tj authored
114
115 (The MIT License)
116
3777bfd @tj Added contributor list
tj authored
117 Copyright (c) 2009 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
8675f12 @tj New doc files
tj authored
118
119 Permission is hereby granted, free of charge, to any person obtaining
120 a copy of this software and associated documentation files (the
121 'Software'), to deal in the Software without restriction, including
122 without limitation the rights to use, copy, modify, merge, publish,
123 distribute, sublicense, and/or sell copies of the Software, and to
124 permit persons to whom the Software is furnished to do so, subject to
125 the following conditions:
126
127 The above copyright notice and this permission notice shall be
128 included in all copies or substantial portions of the Software.
129
130 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
131 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
132 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
133 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
134 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
135 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
4858502 @nomiddlename Asynchronous handlers working.
nomiddlename authored
136 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Something went wrong with that request. Please try again.