Skip to content
Myr

Readme

This file

Path

Readme

108 lines · 2.8 KiB

Last changed by

Performance docsvisionmediabefore adoptioncc5983f

History of this file

Take it

12= 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 serving21  * View support22  * Routing23    * string matching       24    * regexp with captures  25    * param key substitution26    * pre-conditions27    * overidding28    * etc29    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.3637== 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'63  })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').name79  })80  81== Public API8283  * Coming Soon8485== 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.