Files
express/Readme.md

127 lines
4.2 KiB
Markdown
Raw Normal View History

[![express logo](http://f.cl.ly/items/0V2S1n0K1i3y1c122g04/Screen%20Shot%202012-04-11%20at%209.59.42%20AM.png)](http://expressjs.com/)
2010-07-14 10:23:43 -07:00
2013-10-16 19:17:49 -07:00
Fast, unopinionated, minimalist web framework for [node](http://nodejs.org).
[![Build Status](https://secure.travis-ci.org/visionmedia/express.png)](http://travis-ci.org/visionmedia/express) [![Gittip](http://img.shields.io/gittip/visionmedia.png)](https://www.gittip.com/visionmedia/)
2010-07-14 16:27:50 -07:00
```js
var express = require('express');
2012-04-15 13:25:58 -07:00
var app = express();
2010-07-14 16:27:50 -07:00
2012-04-11 10:08:12 -07:00
app.get('/', function(req, res){
res.send('Hello World');
});
app.listen(3000);
```
## Installation
2011-05-02 12:48:45 -07:00
$ npm install -g express
2011-06-01 17:35:14 -07:00
## Quick Start
2011-06-01 17:34:07 -07:00
The quickest way to get started with express is to utilize the executable `express(1)` to generate an application as shown below:
Create the app:
$ npm install -g express
$ express /tmp/foo && cd /tmp/foo
Install dependencies:
2012-04-11 10:08:12 -07:00
$ npm install
2011-06-01 17:34:07 -07:00
Start the server:
2012-04-11 10:08:12 -07:00
$ node app
2011-06-01 17:34:07 -07:00
2010-07-06 06:52:48 -07:00
## Features
2009-07-07 13:53:20 -07:00
2012-04-11 10:08:12 -07:00
* Built on [Connect](http://github.com/senchalabs/connect)
2010-07-14 10:18:12 -07:00
* Robust routing
2012-04-11 10:08:12 -07:00
* HTTP helpers (redirection, caching, etc)
* View system supporting 14+ template engines
2010-07-20 09:29:16 -07:00
* Content negotiation
2010-07-14 10:18:12 -07:00
* Focus on high performance
2010-07-06 06:52:48 -07:00
* Environment based configuration
2010-07-15 14:50:26 -07:00
* Executable for generating applications quickly
2012-04-11 10:08:12 -07:00
* High test coverage
2010-07-06 06:52:48 -07:00
2012-04-11 10:08:12 -07:00
## Philosophy
2010-07-06 06:52:48 -07:00
2012-04-11 10:08:12 -07:00
The Express philosophy is to provide small, robust tooling for HTTP servers. Making
it a great solution for single page applications, web sites, hybrids, or public
HTTP APIs.
2013-02-20 09:18:42 -08:00
2012-04-11 10:08:12 -07:00
Built on Connect you can use _only_ what you need, and nothing more, applications
can be as big or as small as you like, even a single file. Express does
not force you to use any specific ORM or template engine. With support for over
14 template engines via [Consolidate.js](http://github.com/visionmedia/consolidate.js)
you can quickly craft your perfect framework.
2009-12-17 14:24:41 -08:00
2010-07-14 10:18:12 -07:00
## More Information
2010-03-16 07:58:06 -07:00
* [Website and Documentation](http://expressjs.com/) stored at [visionmedia/expressjs.com](https://github.com/visionmedia/expressjs.com)
2012-04-11 10:08:12 -07:00
* Join #express on freenode
2010-07-14 10:18:12 -07:00
* [Google Group](http://groups.google.com/group/express-js) for discussion
2012-04-11 10:08:12 -07:00
* Follow [tjholowaychuk](http://twitter.com/tjholowaychuk) on twitter for updates
2010-09-06 11:37:48 -07:00
* Visit the [Wiki](http://github.com/visionmedia/express/wiki)
* [Русскоязычная документация](http://jsman.ru/express/)
2013-02-20 09:18:42 -08:00
* Run express examples [online](https://runnable.com/express)
2011-07-15 12:12:46 -07:00
2011-05-20 08:39:43 -07:00
## Viewing Examples
2012-09-25 13:55:57 -07:00
Clone the Express repo, then install the dev dependencies to install all the example / test suite deps:
2011-05-20 08:39:43 -07:00
2012-09-25 13:55:57 -07:00
$ git clone git://github.com/visionmedia/express.git --depth 1
2012-04-11 10:08:12 -07:00
$ cd express
2012-06-04 09:48:19 -07:00
$ npm install
2011-05-20 08:39:43 -07:00
then run whichever tests you want:
2012-04-11 10:08:12 -07:00
$ node examples/content-negotiation
2013-10-14 14:16:18 -07:00
You can also view live examples here
<a href="https://runnable.com/express" target="_blank"><img src="https://runnable.com/external/styles/assets/runnablebtn.png" style="width:67px;height:25px;"></a>
2011-05-20 08:39:43 -07:00
2011-05-20 08:35:11 -07:00
## Running Tests
To run the test suite first invoke the following command within the repo, installing the development dependencies:
$ npm install
then run the tests:
$ make test
## Contributors
https://github.com/visionmedia/express/graphs/contributors
2013-02-20 09:18:42 -08:00
## License
2009-07-07 13:53:20 -07:00
(The MIT License)
2012-04-11 10:08:12 -07:00
Copyright (c) 2009-2012 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
2009-07-07 13:53:20 -07:00
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
2009-11-29 13:48:51 +08:00
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.