Readme.md
This file
Path
Readme.md
141 lines · 3.8 KiB · Markdown
Last changed by
Merge branch 'master' of git://github.com/csausdev/express into devvisionmediabefore adoption33ea221
History of this fileTake it
Markdownvisionmediabefore adoptionfa08323
line 1why, one step back1No more ASCII artvisionmediabefore adoptionbf03e85
lines 2–3why, one step back2# Express3 Markdownvisionmediabefore adoptionfa08323
line 4why, one step back4 Insanely fast (and small) server-side JavaScript web development frameworkDocsvisionmediabefore adoption9f06b11
line 5why, one step back5 built on **node.js** and the **V8 JavaScript engine**.Markdownvisionmediabefore adoptionfa08323
lines 6–28why, one step back67 * 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 * etcAdded example, extra info to Readmecsausdevbefore adoption9973bd7
line 29why, one step back29Markdownvisionmediabefore adoptionfa08323
lines 30–33why, one step back30## Performance3132 Extensive benchmarking will wait until a development version33 has been released. However for simple an average route and responseDocsvisionmediabefore adoption9f06b11
lines 34–35why, one step back34 body Ruby's Sinatra scored **1454** request per second using Thin, while35 Express scored **2762**.Markdownvisionmediabefore adoptionfa08323
lines 36–37why, one step back3637## ExamplesAdded example, extra info to Readmecsausdevbefore adoption9973bd7
line 38why, one step back38Asynchronous handlers working.csausdevbefore adoption4858502
line 39why, one step back39See examples/simple.js for a working server that uses a synchronous handler. Merge branch 'master' of git://github.com/csausdev/express into devvisionmediabefore adoption33ea221
lines 40–42why, one step back40Just type "node examples/simple.js" and then go to http://localhost:3000/i/like/cheese4142For an asynchronous example, run "node examples/async.js" and then go to http://localhost:3000/wait/2000Markdownvisionmediabefore adoptionfa08323
line 43why, one step back43Docsvisionmediabefore adoption9f06b11
line 44why, one step back44GET /user/tj/editMarkdownvisionmediabefore adoptionfa08323
lines 45–49why, one step back45 46 get('user/:name/:operation', function(){47 param('operation') + 'ing ' + param('name')48 })49Docsvisionmediabefore adoption9f06b11
line 50why, one step back50GET /articlesMarkdownvisionmediabefore adoptionfa08323
lines 51–55why, one step back51 52 get('articles', function(){53 'list of articles'54 })55Docsvisionmediabefore adoption9f06b11
line 56why, one step back56GET /articles/12Markdownvisionmediabefore adoptionfa08323
lines 57–61why, one step back57 58 get(/articles\/(\d+)/, function(){59 'article id ' + captures[1]60 })61 Docsvisionmediabefore adoption9f06b11
line 62why, one step back62POST /user/:idMarkdownvisionmediabefore adoptionfa08323
lines 63–69why, one step back63 64 post('user/:id', function(){65 User.destroy(params('id')) ? 66 'User deleted' :67 'Failed to delete user'68 })69 Docsvisionmediabefore adoption9f06b11
line 70why, one step back70GET /loginMarkdownvisionmediabefore adoptionfa08323
lines 71–79why, one step back71 72 get('login', function() {73 '<form method="post" action="/login"> \74 <input type="text" name="user[name]" /> \75 <input type="password" name="user[pass]" /> \76 <input type="submit" value="Login"/> \77 </form>'78 })79 Docsvisionmediabefore adoption9f06b11
line 80why, one step back80POST /loginMarkdownvisionmediabefore adoptionfa08323
lines 81–96why, one step back81 82 post('login', function() {83 'Welcome ' + param('user').name84 })85 86## Settings8788 * basepath : defaults to '/'89 * defaultRoute : responds with page not found90 * mime.defaultType : defaults to 'application/octet-stream'91 * cookie.maxAge : defaults to 3600 milliseconds92 93## Public API9495 * Coming Soon96 Readme for testingvisionmediabefore adoption34a55ba
lines 97–101why, one step back97## Running Tests9899Express uses the [JSpec](http://jspec.info) BDD JavaScript testing100framework to write and run elegant spec suites. JSpec is froozen 101to spec/lib and does not require seperate installation.Markdownvisionmediabefore adoptionfa08323
line 102why, one step back102Updated readme with new spec running infovisionmediabefore adoption8e23ebb
line 103why, one step back103To run all specifications:Markdownvisionmediabefore adoptionfa08323
line 104why, one step back104Updated readme with new spec running infovisionmediabefore adoption8e23ebb
line 105why, one step back105 $ make testAmended readme for running individual specscsausdevbefore adoption7459e7d
line 106why, one step back106 Updated readme with new spec running infovisionmediabefore adoption8e23ebb
line 107why, one step back107Run individual suites:Amended readme for running individual specscsausdevbefore adoption7459e7d
lines 108–109why, one step back108109 $ node spec/spec.node.js coreUpdated readme with new spec running infovisionmediabefore adoption8e23ebb
lines 110–112why, one step back110 $ node spec/spec.node.js mime111 $ node spec/spec.node.js routing112 ...Link to Mojo mustache templatesvisionmediabefore adoptionfde2bfc
lines 113–116why, one step back113 114## More Information115116 * [Mojo](http://github.com/visionmedia/mojo) JavaScript Mustache TemplatesMarkdownvisionmediabefore adoptionfa08323
lines 117–141why, one step back117118## License 119120(The MIT License)121122Copyright (c) 2009 TJ Holowaychuk <tj@vision-media.ca>123124Permission is hereby granted, free of charge, to any person obtaining125a copy of this software and associated documentation files (the126'Software'), to deal in the Software without restriction, including127without limitation the rights to use, copy, modify, merge, publish,128distribute, sublicense, and/or sell copies of the Software, and to129permit persons to whom the Software is furnished to do so, subject to130the following conditions:131132The above copyright notice and this permission notice shall be133included in all copies or substantial portions of the Software.134135THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,136EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF137MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.138IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY139CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,140TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE141SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.