Skip to content
Myr

Readme.md

This file

Path

Readme.md

103 lines · 3.0 KiB · Markdown

Last changed by

Updated featuresvisionmediabefore adoption64a4741

History of this file

Take it

The walk stopped after 200 commits: lines older than 5db80e5 point at it.

Patched JSpec to work with nodes apisvisionmediabefore adoption5db80e5

line 1why, one step back
1

No more ASCII artvisionmediabefore adoptionbf03e85

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

Patched JSpec to work with nodes apisvisionmediabefore adoption5db80e5

lines 4–10why, one step back
4 Insanely fast (and small) server-side JavaScript web development framework
5 built on **node.js** and the **V8 JavaScript engine**.67 * Stay tuned, coming soon :)89## Features (so far)10

Updated featuresvisionmediabefore adoption64a4741

lines 11–12why, one step back
11 * Sexy DSL with robust sinatra-like routing
12 * High performance

Patched JSpec to work with nodes apisvisionmediabefore adoption5db80e5

lines 13–15why, one step back
13 * Mime helpers
14 * Nested parameter parsing15 * Full test coverage

Updated featuresvisionmediabefore adoption64a4741

line 16why, one step back
16 * Extremely readable specs

Patched JSpec to work with nodes apisvisionmediabefore adoption5db80e5

line 17why, one step back
17 * Test helpers (mock requests etc)

Updated featuresvisionmediabefore adoption64a4741

lines 18–19why, one step back
18 * Environment based configuration
19 * Light-weight JavaScript class implementation via js-oo

Collection readmevisionmediabefore adoption460c2a0

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

Patched JSpec to work with nodes apisvisionmediabefore adoption5db80e5

lines 21–26why, one step back
21
22## Performance2324 Extensive benchmarking will wait until a development version25 has been released. However for simple an average route and response26 body Ruby's Sinatra scored **1454** request per second using Thin, while

Updated benchmarkingvisionmediabefore adoptioncdaca71

lines 27–30why, one step back
27 Express scored **3600**.
28 29 Currently Express can chew through **1000** simple requests with a 30 concurrency of **40** in **0.262** seconds.

Patched JSpec to work with nodes apisvisionmediabefore adoption5db80e5

lines 31–33why, one step back
31
32## Examples33

Renaming some spec filesvisionmediabefore adoption340cd1d

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

Patched JSpec to work with nodes apisvisionmediabefore adoption5db80e5

line 36why, one step back
36

Renaming some spec filesvisionmediabefore adoption340cd1d

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

Patched JSpec to work with nodes apisvisionmediabefore adoption5db80e5

line 38why, one step back
38

Renaming some spec filesvisionmediabefore adoption340cd1d

lines 39–43why, one step back
39 get('/user/:id?', function() {
40 if (param('id'))41 return 'Viewing user ' + param('id')42 return 'Your user account'43 })

Patched JSpec to work with nodes apisvisionmediabefore adoption5db80e5

lines 44–46why, one step back
44
45## Settings46

Renaming some spec filesvisionmediabefore adoption340cd1d

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

Patched JSpec to work with nodes apisvisionmediabefore adoption5db80e5

line 49why, one step back
49

Renaming some spec filesvisionmediabefore adoption340cd1d

lines 50–52why, one step back
50 enable('foo')
51 disable('bar')52

Collection readmevisionmediabefore adoption460c2a0

lines 53–55why, one step back
53## Collections
5455Express ships with the Collection class, allowing

Renaming some spec filesvisionmediabefore adoption340cd1d

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

Collection readmevisionmediabefore adoption460c2a0

lines 57–62why, one step back
57
58 $(['tj', 'matt', 'taylor'])59 .select(function(name){ return name.charAt(0) == 't' })60 .reject(function(name){ return name.length < 4 })61 .first()62

Readme for testingvisionmediabefore adoption34a55ba

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

Patched JSpec to work with nodes apisvisionmediabefore adoption5db80e5

lines 68–103why, one step back
68
69To run all specifications:7071 $ make test72 73Run individual suites:7475 $ node spec/spec.node.js core76 $ node spec/spec.node.js mime77 $ node spec/spec.node.js routing78 ...79 80## License 8182(The MIT License)8384Copyright (c) 2009 TJ Holowaychuk <tj@vision-media.ca>8586Permission is hereby granted, free of charge, to any person obtaining87a copy of this software and associated documentation files (the88'Software'), to deal in the Software without restriction, including89without limitation the rights to use, copy, modify, merge, publish,90distribute, sublicense, and/or sell copies of the Software, and to91permit persons to whom the Software is furnished to do so, subject to92the following conditions:9394The above copyright notice and this permission notice shall be95included in all copies or substantial portions of the Software.9697THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,98EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF99MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.100IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY101CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,102TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE103SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.