Files
express/Readme.md

154 lines
4.7 KiB
Markdown
Raw Normal View History

2014-08-24 10:05:24 -04:00
[![Express Logo](https://i.cloudup.com/zfY6lL7eFa-3000x3000.png)](http://expressjs.com/)
2010-07-14 10:23:43 -07:00
2014-07-08 21:47:11 -07:00
Fast, unopinionated, minimalist web framework for [node](http://nodejs.org).
2013-10-16 19:17:49 -07:00
2014-10-11 14:12:03 -04:00
[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
2015-02-18 23:11:45 -05:00
[![Linux Build][travis-image]][travis-url]
[![Windows Build][appveyor-image]][appveyor-url]
2014-10-11 14:12:03 -04:00
[![Test Coverage][coveralls-image]][coveralls-url]
2010-07-14 16:27:50 -07:00
```js
var express = require('express')
var app = express()
2010-07-14 16:27:50 -07:00
app.get('/', function (req, res) {
res.send('Hello World')
})
2012-04-11 10:08:12 -07:00
app.listen(3000)
2012-04-11 10:08:12 -07:00
```
2014-12-15 20:41:05 -08:00
## Installation
2011-05-02 12:48:45 -07:00
This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/).
Before installing, [download and install Node.js](https://nodejs.org/en/download/).
Node.js 0.10 or higher is required.
Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
```bash
$ npm install express
```
2011-05-02 12:48:45 -07:00
Follow [our installing guide](http://expressjs.com/en/starter/installing.html)
for more information.
2014-10-11 14:12:03 -04:00
## Features
* Robust routing
* Focus on high performance
* Super-high test coverage
* HTTP helpers (redirection, caching, etc)
* View system supporting 14+ template engines
* Content negotiation
* Executable for generating applications quickly
## Docs & Community
* [Website and Documentation](http://expressjs.com/) - [[website repo](https://github.com/expressjs/expressjs.com)]
2014-10-11 14:12:03 -04:00
* [#express](https://webchat.freenode.net/?channels=express) on freenode IRC
* [GitHub Organization](https://github.com/expressjs) for Official Middleware & Modules
* Visit the [Wiki](https://github.com/expressjs/express/wiki)
2014-10-11 14:12:03 -04:00
* [Google Group](https://groups.google.com/group/express-js) for discussion
2016-01-21 20:59:53 -05:00
* [Gitter](https://gitter.im/expressjs/express) for support and discussion
2014-10-11 14:12:03 -04:00
**PROTIP** Be sure to read [Migrating from 3.x to 4.x](https://github.com/expressjs/express/wiki/Migrating-from-3.x-to-4.x) as well as [New features in 4.x](https://github.com/expressjs/express/wiki/New-features-in-4.x).
### Security Issues
If you discover a security vulnerability in Express, please see [Security Policies and Procedures](Security.md).
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)`](https://github.com/expressjs/generator) to generate an application as shown below:
Install the executable. The executable's major version will match Express's:
2011-06-01 17:34:07 -07:00
```bash
$ npm install -g express-generator@4
```
2011-06-01 17:34:07 -07:00
Create the app:
```bash
$ express /tmp/foo && cd /tmp/foo
```
2011-06-01 17:34:07 -07:00
Install dependencies:
2011-06-01 17:34:07 -07:00
```bash
$ npm install
```
2011-06-01 17:34:07 -07:00
Start the server:
2011-06-01 17:34:07 -07:00
```bash
$ npm start
```
2011-06-01 17:34:07 -07:00
2012-04-11 10:08:12 -07:00
## Philosophy
2010-07-06 06:52:48 -07:00
The Express philosophy is to provide small, robust tooling for HTTP servers, making
2012-04-11 10:08:12 -07:00
it a great solution for single page applications, web sites, hybrids, or public
HTTP APIs.
2013-02-20 09:18:42 -08:00
2014-03-02 23:32:51 -08:00
Express does not force you to use any specific ORM or template engine. With support for over
2014-10-23 02:20:51 -04:00
14 template engines via [Consolidate.js](https://github.com/tj/consolidate.js),
you can quickly craft your perfect framework.
2009-12-17 14:24:41 -08:00
2014-10-11 14:12:03 -04:00
## Examples
2010-03-16 07:58:06 -07:00
2015-03-18 20:25:11 +02:00
To view the examples, clone the Express repo and install the dependencies:
2011-05-20 08:39:43 -07:00
```bash
2016-01-21 20:59:53 -05:00
$ git clone git://github.com/expressjs/express.git --depth 1
$ cd express
$ npm install
```
2011-05-20 08:39:43 -07:00
Then run whichever example you want:
2011-05-20 08:39:43 -07:00
2014-10-11 14:12:03 -04:00
```bash
$ node examples/content-negotiation
```
2011-05-20 08:39:43 -07:00
2014-10-11 14:12:03 -04:00
## Tests
2011-05-20 08:35:11 -07:00
2015-03-11 19:44:45 -04:00
To run the test suite, first install the dependencies, then run `npm test`:
2011-05-20 08:35:11 -07:00
```bash
$ npm install
2014-10-11 14:12:03 -04:00
$ npm test
```
2011-05-20 08:35:11 -07:00
2014-12-15 20:41:05 -08:00
## People
2011-05-20 08:35:11 -07:00
The original author of Express is [TJ Holowaychuk](https://github.com/tj)
2011-05-20 08:35:11 -07:00
The current lead maintainer is [Douglas Christopher Wilson](https://github.com/dougwilson)
2016-01-21 20:59:53 -05:00
[List of all contributors](https://github.com/expressjs/express/graphs/contributors)
2014-12-15 20:41:05 -08:00
## License
2009-07-07 13:53:20 -07:00
[MIT](LICENSE)
2014-10-11 14:12:03 -04:00
2015-02-18 23:09:47 -05:00
[npm-image]: https://img.shields.io/npm/v/express.svg
2014-10-11 14:12:03 -04:00
[npm-url]: https://npmjs.org/package/express
2015-02-18 23:09:47 -05:00
[downloads-image]: https://img.shields.io/npm/dm/express.svg
2014-10-11 14:12:03 -04:00
[downloads-url]: https://npmjs.org/package/express
2016-01-21 20:59:53 -05:00
[travis-image]: https://img.shields.io/travis/expressjs/express/master.svg?label=linux
[travis-url]: https://travis-ci.org/expressjs/express
2015-02-18 23:11:45 -05:00
[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/express/master.svg?label=windows
[appveyor-url]: https://ci.appveyor.com/project/dougwilson/express
2016-01-21 20:59:53 -05:00
[coveralls-image]: https://img.shields.io/coveralls/expressjs/express/master.svg
[coveralls-url]: https://coveralls.io/r/expressjs/express?branch=master
2015-02-18 23:09:47 -05:00
[gratipay-image-visionmedia]: https://img.shields.io/gratipay/visionmedia.svg
2014-10-30 18:22:46 +00:00
[gratipay-url-visionmedia]: https://gratipay.com/visionmedia/
2015-02-18 23:09:47 -05:00
[gratipay-image-dougwilson]: https://img.shields.io/gratipay/dougwilson.svg
2014-10-30 18:22:46 +00:00
[gratipay-url-dougwilson]: https://gratipay.com/dougwilson/