Markdown
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by visionmedia · committed by visionmedia · parent 0739b0b · Browse files · 2 files·+121 added−115 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+121 added−115 removed
- other:+121 added−115 removed
Provenance
- Commit
fa08323- Tree
44cd551- Author
visionmedia <tj@vision-media.ca>- Committer
visionmedia <tj@vision-media.ca>- Parent
0739b0b
2 files changed+121 added−115 removed
deleted:Readme-115 removed
1-2-= Express3-4- Insanely fast (and small) server-side JavaScript web development framework5- built on node.js and the V8 JavaScript engine.6-7- * Stay tuned, coming soon :)8-9-== Features (so far)10-11- * 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-== Performance31-32- 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.36-37-== Examples38-39- // GET /user/tj/edit40- 41- get('user/:name/:operation', function(){42- param('operation') + 'ing ' + param('name')43- })44-45- // GET /articles46- 47- get('articles', function(){48- 'list of articles'49- })50-51- // 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 /login76-77- post('login', function() {78- 'Welcome ' + param('user').name79- })80- 81-== Settings82-83- * basepath : defaults to '/'84- * defaultRoute : responds with page not found85- * mime.defaultType : defaults to 'application/octet-stream'86- * cookie.maxAge : defaults to 3600 milliseconds87- 88-== Public API89-90- * Coming Soon91-92-== License 93-94-(The MIT License)95-96-Copyright (c) 2009 TJ Holowaychuk <tj@vision-media.ca>97-98-Permission is hereby granted, free of charge, to any person obtaining99-a copy of this software and associated documentation files (the100-'Software'), to deal in the Software without restriction, including101-without limitation the rights to use, copy, modify, merge, publish,102-distribute, sublicense, and/or sell copies of the Software, and to103-permit persons to whom the Software is furnished to do so, subject to104-the following conditions:105-106-The above copyright notice and this permission notice shall be107-included in all copies or substantial portions of the Software.108-109-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,110-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF111-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.112-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY113-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,114-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE115-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.added:Readme.md+121 added
1+2+# Express3+4+ Insanely fast (and small) server-side JavaScript web development framework5+ built on node.js and the V8 JavaScript engine.6+7+ * Stay tuned, coming soon :)8+9+## Features (so far)10+11+ * 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+## Performance31+32+ 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.36+37+## Examples38+39+ // GET /user/tj/edit40+ 41+ get('user/:name/:operation', function(){42+ param('operation') + 'ing ' + param('name')43+ })44+45+ // GET /articles46+ 47+ get('articles', function(){48+ 'list of articles'49+ })50+51+ // 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 /login76+ 77+ post('login', function() {78+ 'Welcome ' + param('user').name79+ })80+ 81+## Settings82+83+ * basepath : defaults to '/'84+ * defaultRoute : responds with page not found85+ * mime.defaultType : defaults to 'application/octet-stream'86+ * cookie.maxAge : defaults to 3600 milliseconds87+ 88+## Public API89+90+ * Coming Soon91+ 92+## Testing93+94+Install [JSpec](http://jspec.info), edit the path to JSpec on your machine, and run:95+96+ $ node spec/spec.node.js97+98+## License 99+100+(The MIT License)101+102+Copyright (c) 2009 TJ Holowaychuk <tj@vision-media.ca>103+104+Permission is hereby granted, free of charge, to any person obtaining105+a copy of this software and associated documentation files (the106+'Software'), to deal in the Software without restriction, including107+without limitation the rights to use, copy, modify, merge, publish,108+distribute, sublicense, and/or sell copies of the Software, and to109+permit persons to whom the Software is furnished to do so, subject to110+the following conditions:111+112+The above copyright notice and this permission notice shall be113+included in all copies or substantial portions of the Software.114+115+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,116+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF117+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.118+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY119+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,120+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE121+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.