You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

153 lines
4.7 KiB

  1. [![Express Logo](https://i.cloudup.com/zfY6lL7eFa-3000x3000.png)](http://expressjs.com/)
  2. Fast, unopinionated, minimalist web framework for [node](http://nodejs.org).
  3. [![NPM Version][npm-image]][npm-url]
  4. [![NPM Downloads][downloads-image]][downloads-url]
  5. [![Linux Build][travis-image]][travis-url]
  6. [![Windows Build][appveyor-image]][appveyor-url]
  7. [![Test Coverage][coveralls-image]][coveralls-url]
  8. ```js
  9. var express = require('express')
  10. var app = express()
  11. app.get('/', function (req, res) {
  12. res.send('Hello World')
  13. })
  14. app.listen(3000)
  15. ```
  16. ## Installation
  17. This is a [Node.js](https://nodejs.org/en/) module available through the
  18. [npm registry](https://www.npmjs.com/).
  19. Before installing, [download and install Node.js](https://nodejs.org/en/download/).
  20. Node.js 0.10 or higher is required.
  21. Installation is done using the
  22. [`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
  23. ```bash
  24. $ npm install express
  25. ```
  26. Follow [our installing guide](http://expressjs.com/en/starter/installing.html)
  27. for more information.
  28. ## Features
  29. * Robust routing
  30. * Focus on high performance
  31. * Super-high test coverage
  32. * HTTP helpers (redirection, caching, etc)
  33. * View system supporting 14+ template engines
  34. * Content negotiation
  35. * Executable for generating applications quickly
  36. ## Docs & Community
  37. * [Website and Documentation](http://expressjs.com/) - [[website repo](https://github.com/expressjs/expressjs.com)]
  38. * [#express](https://webchat.freenode.net/?channels=express) on freenode IRC
  39. * [GitHub Organization](https://github.com/expressjs) for Official Middleware & Modules
  40. * Visit the [Wiki](https://github.com/expressjs/express/wiki)
  41. * [Google Group](https://groups.google.com/group/express-js) for discussion
  42. * [Gitter](https://gitter.im/expressjs/express) for support and discussion
  43. **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).
  44. ### Security Issues
  45. If you discover a security vulnerability in Express, please see [Security Policies and Procedures](Security.md).
  46. ## Quick Start
  47. 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:
  48. Install the executable. The executable's major version will match Express's:
  49. ```bash
  50. $ npm install -g express-generator@4
  51. ```
  52. Create the app:
  53. ```bash
  54. $ express /tmp/foo && cd /tmp/foo
  55. ```
  56. Install dependencies:
  57. ```bash
  58. $ npm install
  59. ```
  60. Start the server:
  61. ```bash
  62. $ npm start
  63. ```
  64. ## Philosophy
  65. The Express philosophy is to provide small, robust tooling for HTTP servers, making
  66. it a great solution for single page applications, web sites, hybrids, or public
  67. HTTP APIs.
  68. Express does not force you to use any specific ORM or template engine. With support for over
  69. 14 template engines via [Consolidate.js](https://github.com/tj/consolidate.js),
  70. you can quickly craft your perfect framework.
  71. ## Examples
  72. To view the examples, clone the Express repo and install the dependencies:
  73. ```bash
  74. $ git clone git://github.com/expressjs/express.git --depth 1
  75. $ cd express
  76. $ npm install
  77. ```
  78. Then run whichever example you want:
  79. ```bash
  80. $ node examples/content-negotiation
  81. ```
  82. ## Tests
  83. To run the test suite, first install the dependencies, then run `npm test`:
  84. ```bash
  85. $ npm install
  86. $ npm test
  87. ```
  88. ## People
  89. The original author of Express is [TJ Holowaychuk](https://github.com/tj)
  90. The current lead maintainer is [Douglas Christopher Wilson](https://github.com/dougwilson)
  91. [List of all contributors](https://github.com/expressjs/express/graphs/contributors)
  92. ## License
  93. [MIT](LICENSE)
  94. [npm-image]: https://img.shields.io/npm/v/express.svg
  95. [npm-url]: https://npmjs.org/package/express
  96. [downloads-image]: https://img.shields.io/npm/dm/express.svg
  97. [downloads-url]: https://npmjs.org/package/express
  98. [travis-image]: https://img.shields.io/travis/expressjs/express/master.svg?label=linux
  99. [travis-url]: https://travis-ci.org/expressjs/express
  100. [appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/express/master.svg?label=windows
  101. [appveyor-url]: https://ci.appveyor.com/project/dougwilson/express
  102. [coveralls-image]: https://img.shields.io/coveralls/expressjs/express/master.svg
  103. [coveralls-url]: https://coveralls.io/r/expressjs/express?branch=master
  104. [gratipay-image-visionmedia]: https://img.shields.io/gratipay/visionmedia.svg
  105. [gratipay-url-visionmedia]: https://gratipay.com/visionmedia/
  106. [gratipay-image-dougwilson]: https://img.shields.io/gratipay/dougwilson.svg
  107. [gratipay-url-dougwilson]: https://gratipay.com/dougwilson/