Readme
This file
Path
Readme
108 lines · 2.8 KiB
Last changed by
Performance docsvisionmediabefore adoptioncc5983f
History of this fileTake it
New doc filesvisionmediabefore adoption8675f12
lines 1–20why, one step back12= Express34 Insanely fast (and small) server-side JavaScript web development framework5 built on node.js and the V8 JavaScript engine.67 * 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 servingDocsvisionmediabefore adoption05ea7a5
line 21why, one step back21 * View supportNew doc filesvisionmediabefore adoption8675f12
lines 22–28why, one step back22 * Routing23 * string matching 24 * regexp with captures 25 * param key substitution26 * pre-conditions27 * overidding28 * etcPerformance docsvisionmediabefore adoptioncc5983f
lines 29–35why, one step back29 30== Performance3132 Extensive benchmarking will wait until a development version33 has been released. However for simple an average route and response34 body Ruby's Sinatra scored 1454 request per second using Thin, while35 Express scored 2762.New doc filesvisionmediabefore adoption8675f12
lines 36–62why, one step back3637== Examples3839 // GET /user/tj/edit40 41 get('user/:name/:operation', function(){42 param('operation') + 'ing ' + param('name')43 })4445 // GET /articles46 47 get('articles', function(){48 'list of articles'49 })5051 // GET /articles/1252 53 get(/articles\/(\d+)/, function(){54 'article id ' + captures[1]55 })56 57 // POST /user/:id58 59 post('user/:id', function(){60 User.destroy(params('id')) ? 61 'User deleted' :62 'Failed to delete user'Added POST urlencoded body parsingvisionmediabefore adoption7807f42
lines 63–78why, one step back63 })64 65 // GET /login66 67 get('login', function() {68 '<form method="post" action="/login"> \69 <input type="text" name="user[name]" /> \70 <input type="password" name="user[pass]" /> \71 <input type="submit" value="Login"/> \72 </form>'73 })74 75 // POST /login7677 post('login', function() {78 'Welcome ' + param('user').nameNew doc filesvisionmediabefore adoption8675f12
lines 79–80why, one step back79 })80 Coming soon (public api docs)visionmediabefore adoption3a3be0f
line 81why, one step back81== Public APINew doc filesvisionmediabefore adoption8675f12
line 82why, one step back82Coming soon (public api docs)visionmediabefore adoption3a3be0f
line 83why, one step back83 * Coming SoonNew doc filesvisionmediabefore adoption8675f12
lines 84–108why, one step back8485== License 8687(The MIT License)8889Copyright (c) 2009 TJ Holowaychuk <tj@vision-media.ca>9091Permission is hereby granted, free of charge, to any person obtaining92a copy of this software and associated documentation files (the93'Software'), to deal in the Software without restriction, including94without limitation the rights to use, copy, modify, merge, publish,95distribute, sublicense, and/or sell copies of the Software, and to96permit persons to whom the Software is furnished to do so, subject to97the following conditions:9899The above copyright notice and this permission notice shall be100included in all copies or substantial portions of the Software.101102THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,103EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF104MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.105IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY106CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,107TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE108SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.