UNPKG

4.61 kBMarkdownView Raw
1[![express logo](http://f.cl.ly/items/0V2S1n0K1i3y1c122g04/Screen%20Shot%202012-04-11%20at%209.59.42%20AM.png)](http://expressjs.com/)
2
3 Fast, unopinionated, minimalist web framework for [node](http://nodejs.org).
4
5 [![NPM version](https://img.shields.io/npm/v/express.svg?style=flat)](https://www.npmjs.org/package/express)
6 [![Build Status](https://img.shields.io/travis/strongloop/express.svg?style=flat)](https://travis-ci.org/strongloop/express)
7 [![Coverage Status](https://img.shields.io/coveralls/strongloop/express.svg?style=flat)](https://coveralls.io/r/strongloop/express)
8 [![Gratipay](https://img.shields.io/gratipay/dougwilson.svg?style=flat)](https://gratipay.com/dougwilson/)
9
10```js
11var express = require('express');
12var app = express();
13
14app.get('/', function(req, res){
15 res.send('Hello World');
16});
17
18app.listen(3000);
19```
20
21## Installation
22
23 $ npm install -g express
24
25## Quick Start
26
27 The quickest way to get started with express is to utilize the executable `express(1)` to generate an application as shown below:
28
29 Create the app:
30
31 $ npm install -g express
32 $ express /tmp/foo && cd /tmp/foo
33
34 Install dependencies:
35
36 $ npm install
37
38 Start the server:
39
40 $ node app
41
42## Features
43
44 * Built on [Connect](http://github.com/senchalabs/connect)
45 * Robust routing
46 * HTTP helpers (redirection, caching, etc)
47 * View system supporting 14+ template engines
48 * Content negotiation
49 * Focus on high performance
50 * Environment based configuration
51 * Executable for generating applications quickly
52 * High test coverage
53
54## Philosophy
55
56 The Express philosophy is to provide small, robust tooling for HTTP servers, making
57 it a great solution for single page applications, web sites, hybrids, or public
58 HTTP APIs.
59
60 Built on Connect, you can use _only_ what you need, and nothing more. Applications
61 can be as big or as small as you like, even a single file. Express does
62 not force you to use any specific ORM or template engine. With support for over
63 14 template engines via [Consolidate.js](http://github.com/visionmedia/consolidate.js),
64 you can quickly craft your perfect framework.
65
66## More Information
67
68 * [Website and Documentation](http://expressjs.com/) stored at [strongloop/expressjs.com](https://github.com/strongloop/expressjs.com)
69 * Join #express on freenode
70 * [Google Group](http://groups.google.com/group/express-js) for discussion
71 * Follow [tjholowaychuk](http://twitter.com/tjholowaychuk) on twitter for updates
72 * Visit the [Wiki](http://github.com/strongloop/express/wiki)
73 * [Русскоязычная документация](http://jsman.ru/express/)
74 * Run express examples [online](https://runnable.com/express)
75
76## Viewing Examples
77
78Clone the Express repo, then install the dev dependencies to install all the example / test suite dependencies:
79
80 $ git clone git://github.com/strongloop/express.git --depth 1
81 $ cd express
82 $ npm install
83
84Then run whichever tests you want:
85
86 $ node examples/content-negotiation
87
88You can also view live examples here:
89
90<a href="https://runnable.com/express" target="_blank"><img src="https://runnable.com/external/styles/assets/runnablebtn.png" style="width:67px;height:25px;"></a>
91
92## Running Tests
93
94To run the test suite, first invoke the following command within the repo, installing the development dependencies:
95
96 $ npm install
97
98Then run the tests:
99
100```sh
101$ npm test
102```
103
104## Contributors
105
106 https://github.com/strongloop/express/graphs/contributors
107
108## License
109
110(The MIT License)
111
112Copyright (c) 2009-2012 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
113
114Permission is hereby granted, free of charge, to any person obtaining
115a copy of this software and associated documentation files (the
116'Software'), to deal in the Software without restriction, including
117without limitation the rights to use, copy, modify, merge, publish,
118distribute, sublicense, and/or sell copies of the Software, and to
119permit persons to whom the Software is furnished to do so, subject to
120the following conditions:
121
122The above copyright notice and this permission notice shall be
123included in all copies or substantial portions of the Software.
124
125THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
126EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
127MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
128IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
129CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
130TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
131SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.