rc@73
|
1 [](http://expressjs.com/)
|
rc@73
|
2
|
rc@73
|
3 Fast, unopinionated, minimalist web framework for [node](http://nodejs.org).
|
rc@73
|
4
|
rc@73
|
5 [](http://badge.fury.io/js/express)
|
rc@73
|
6 [](https://travis-ci.org/visionmedia/express)
|
rc@73
|
7 [](https://coveralls.io/r/visionmedia/express)
|
rc@73
|
8 [](https://www.gittip.com/visionmedia/)
|
rc@73
|
9
|
rc@73
|
10 ```js
|
rc@73
|
11 var express = require('express');
|
rc@73
|
12 var app = express();
|
rc@73
|
13
|
rc@73
|
14 app.get('/', function(req, res){
|
rc@73
|
15 res.send('Hello World');
|
rc@73
|
16 });
|
rc@73
|
17
|
rc@73
|
18 app.listen(3000);
|
rc@73
|
19 ```
|
rc@73
|
20
|
rc@73
|
21 **PROTIP** Be sure to read [Migrating from 3.x to 4.x](https://github.com/visionmedia/express/wiki/Migrating-from-3.x-to-4.x) as well as [New features in 4.x](https://github.com/visionmedia/express/wiki/New-features-in-4.x).
|
rc@73
|
22
|
rc@73
|
23 ## Installation
|
rc@73
|
24
|
rc@73
|
25 $ npm install express
|
rc@73
|
26
|
rc@73
|
27 ## Quick Start
|
rc@73
|
28
|
rc@73
|
29 The quickest way to get started with express is to utilize the executable [`express(1)`](http://github.com/expressjs/generator) to generate an application as shown below:
|
rc@73
|
30
|
rc@73
|
31 Install the executable. The executable's major version will match Express's:
|
rc@73
|
32
|
rc@73
|
33 $ npm install -g express-generator@3
|
rc@73
|
34
|
rc@73
|
35 Create the app:
|
rc@73
|
36
|
rc@73
|
37 $ express /tmp/foo && cd /tmp/foo
|
rc@73
|
38
|
rc@73
|
39 Install dependencies:
|
rc@73
|
40
|
rc@73
|
41 $ npm install
|
rc@73
|
42
|
rc@73
|
43 Start the server:
|
rc@73
|
44
|
rc@73
|
45 $ npm start
|
rc@73
|
46
|
rc@73
|
47 ## Features
|
rc@73
|
48
|
rc@73
|
49 * Robust routing
|
rc@73
|
50 * HTTP helpers (redirection, caching, etc)
|
rc@73
|
51 * View system supporting 14+ template engines
|
rc@73
|
52 * Content negotiation
|
rc@73
|
53 * Focus on high performance
|
rc@73
|
54 * Executable for generating applications quickly
|
rc@73
|
55 * High test coverage
|
rc@73
|
56
|
rc@73
|
57 ## Philosophy
|
rc@73
|
58
|
rc@73
|
59 The Express philosophy is to provide small, robust tooling for HTTP servers, making
|
rc@73
|
60 it a great solution for single page applications, web sites, hybrids, or public
|
rc@73
|
61 HTTP APIs.
|
rc@73
|
62
|
rc@73
|
63 Express does not force you to use any specific ORM or template engine. With support for over
|
rc@73
|
64 14 template engines via [Consolidate.js](http://github.com/visionmedia/consolidate.js),
|
rc@73
|
65 you can quickly craft your perfect framework.
|
rc@73
|
66
|
rc@73
|
67 ## More Information
|
rc@73
|
68
|
rc@73
|
69 * [Website and Documentation](http://expressjs.com/) stored at [visionmedia/expressjs.com](https://github.com/visionmedia/expressjs.com)
|
rc@73
|
70 * Join #express on freenode
|
rc@73
|
71 * [Google Group](http://groups.google.com/group/express-js) for discussion
|
rc@73
|
72 * Follow [tjholowaychuk](http://twitter.com/tjholowaychuk) and [defunctzombie](https://twitter.com/defunctzombie) on twitter for updates
|
rc@73
|
73 * Visit the [Wiki](http://github.com/visionmedia/express/wiki)
|
rc@73
|
74 * [Русскоязычная документация](http://jsman.ru/express/)
|
rc@73
|
75 * Run express examples [online](https://runnable.com/express)
|
rc@73
|
76
|
rc@73
|
77 ## Viewing Examples
|
rc@73
|
78
|
rc@73
|
79 Clone the Express repo, then install the dev dependencies to install all the example / test suite dependencies:
|
rc@73
|
80
|
rc@73
|
81 $ git clone git://github.com/visionmedia/express.git --depth 1
|
rc@73
|
82 $ cd express
|
rc@73
|
83 $ npm install
|
rc@73
|
84
|
rc@73
|
85 Then run whichever tests you want:
|
rc@73
|
86
|
rc@73
|
87 $ node examples/content-negotiation
|
rc@73
|
88
|
rc@73
|
89 You can also view live examples here:
|
rc@73
|
90
|
rc@73
|
91 <a href="https://runnable.com/express" target="_blank"><img src="https://runnable.com/external/styles/assets/runnablebtn.png" style="width:67px;height:25px;"></a>
|
rc@73
|
92
|
rc@73
|
93 ## Running Tests
|
rc@73
|
94
|
rc@73
|
95 To run the test suite, first invoke the following command within the repo, installing the development dependencies:
|
rc@73
|
96
|
rc@73
|
97 $ npm install
|
rc@73
|
98
|
rc@73
|
99 Then run the tests:
|
rc@73
|
100
|
rc@73
|
101 ```sh
|
rc@73
|
102 $ npm test
|
rc@73
|
103 ```
|
rc@73
|
104
|
rc@73
|
105 ## Contributors
|
rc@73
|
106
|
rc@73
|
107 Author: [TJ Holowaychuk](http://github.com/visionmedia)
|
rc@73
|
108 Lead Maintainer: [Roman Shtylman](https://github.com/defunctzombie)
|
rc@73
|
109 Contributors: https://github.com/visionmedia/express/graphs/contributors
|
rc@73
|
110
|
rc@73
|
111 ## License
|
rc@73
|
112
|
rc@73
|
113 MIT
|