Skip to content
Myr

Readme.md

This file

Path

Readme.md

109 lines · 3.0 KiB · Markdown

Last changed by

Renaming some spec filesvisionmediabefore adoption340cd1d

History of this file

Take it

Markdownvisionmediabefore adoptionfa08323

line 1why, one step back
1

No more ASCII artvisionmediabefore adoptionbf03e85

lines 2–3why, one step back
2# Express
3

Markdownvisionmediabefore adoptionfa08323

line 4why, one step back
4 Insanely fast (and small) server-side JavaScript web development framework

Docsvisionmediabefore adoption9f06b11

line 5why, one step back
5 built on **node.js** and the **V8 JavaScript engine**.

Markdownvisionmediabefore adoptionfa08323

lines 6–21why, one step back
6
7 * Stay tuned, coming soon :)89## Features (so far)1011 * Sexy DSL12 * Mime helpers13 * Nested parameter parsing14 * Full test coverage15 * Test helpers (mock requests etc)16 * Cookie support17 * Session support18 * Faux method support for RESTful apps19 * Extendable using Express 'Modules'20 * Static file serving21 * View support

Collection readmevisionmediabefore adoption460c2a0

line 22why, one step back
22 * Collections and chainable iterators

Markdownvisionmediabefore adoptionfa08323

lines 23–29why, one step back
23 * Routing
24 * string matching 25 * regexp with captures 26 * param key substitution27 * pre-conditions28 * overidding29 * etc

Added example, extra info to Readmecsausdevbefore adoption9973bd7

line 30why, one step back
30

Markdownvisionmediabefore adoptionfa08323

lines 31–34why, one step back
31## Performance
3233 Extensive benchmarking will wait until a development version34 has been released. However for simple an average route and response

Docsvisionmediabefore adoption9f06b11

lines 35–36why, one step back
35 body Ruby's Sinatra scored **1454** request per second using Thin, while
36 Express scored **2762**.

Markdownvisionmediabefore adoptionfa08323

lines 37–38why, one step back
37
38## Examples

Added example, extra info to Readmecsausdevbefore adoption9973bd7

line 39why, one step back
39

Renaming some spec filesvisionmediabefore adoption340cd1d

lines 40–41why, one step back
40 require.paths.unshift("./lib")
41 require('express')

Markdownvisionmediabefore adoptionfa08323

line 42why, one step back
42

Renaming some spec filesvisionmediabefore adoption340cd1d

line 43why, one step back
43 set('views', dirname(__filename) + '/views')

Markdownvisionmediabefore adoptionfa08323

line 44why, one step back
44

Renaming some spec filesvisionmediabefore adoption340cd1d

lines 45–49why, one step back
45 get('/user/:id?', function() {
46 if (param('id'))47 return 'Viewing user ' + param('id')48 return 'Your user account'49 })

Markdownvisionmediabefore adoptionfa08323

lines 50–52why, one step back
50
51## Settings52

Renaming some spec filesvisionmediabefore adoption340cd1d

lines 53–54why, one step back
53 set('views', '/path/to/views')
54 set('views') // => '/path/to/views'

Markdownvisionmediabefore adoptionfa08323

line 55why, one step back
55

Renaming some spec filesvisionmediabefore adoption340cd1d

lines 56–58why, one step back
56 enable('foo')
57 disable('bar')58

Collection readmevisionmediabefore adoption460c2a0

lines 59–61why, one step back
59## Collections
6061Express ships with the Collection class, allowing

Renaming some spec filesvisionmediabefore adoption340cd1d

line 62why, one step back
62you to chain iterations on array-like objects and objects.

Collection readmevisionmediabefore adoption460c2a0

lines 63–68why, one step back
63
64 $(['tj', 'matt', 'taylor'])65 .select(function(name){ return name.charAt(0) == 't' })66 .reject(function(name){ return name.length < 4 })67 .first()68

Readme for testingvisionmediabefore adoption34a55ba

lines 69–73why, one step back
69## Running Tests
7071Express uses the [JSpec](http://jspec.info) BDD JavaScript testing72framework to write and run elegant spec suites. JSpec is froozen 73to spec/lib and does not require seperate installation.

Markdownvisionmediabefore adoptionfa08323

line 74why, one step back
74

Updated readme with new spec running infovisionmediabefore adoption8e23ebb

line 75why, one step back
75To run all specifications:

Markdownvisionmediabefore adoptionfa08323

line 76why, one step back
76

Updated readme with new spec running infovisionmediabefore adoption8e23ebb

line 77why, one step back
77 $ make test

Amended readme for running individual specscsausdevbefore adoption7459e7d

line 78why, one step back
78

Updated readme with new spec running infovisionmediabefore adoption8e23ebb

line 79why, one step back
79Run individual suites:

Amended readme for running individual specscsausdevbefore adoption7459e7d

lines 80–81why, one step back
80
81 $ node spec/spec.node.js core

Updated readme with new spec running infovisionmediabefore adoption8e23ebb

lines 82–84why, one step back
82 $ node spec/spec.node.js mime
83 $ node spec/spec.node.js routing84 ...

Link to Mojo mustache templatesvisionmediabefore adoptionfde2bfc

line 85why, one step back
85

Markdownvisionmediabefore adoptionfa08323

lines 86–109why, one step back
86## License
8788(The MIT License)8990Copyright (c) 2009 TJ Holowaychuk <tj@vision-media.ca>9192Permission is hereby granted, free of charge, to any person obtaining93a copy of this software and associated documentation files (the94'Software'), to deal in the Software without restriction, including95without limitation the rights to use, copy, modify, merge, publish,96distribute, sublicense, and/or sell copies of the Software, and to97permit persons to whom the Software is furnished to do so, subject to98the following conditions:99100The above copyright notice and this permission notice shall be101included in all copies or substantial portions of the Software.102103THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,104EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF105MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.106IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY107CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,108TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE109SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.