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.

155 lines
4.5 KiB

4 years ago
  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. const express = require('express')
  10. const 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. View the website at: http://localhost:3000
  65. ## Philosophy
  66. The Express philosophy is to provide small, robust tooling for HTTP servers, making
  67. it a great solution for single page applications, web sites, hybrids, or public
  68. HTTP APIs.
  69. Express does not force you to use any specific ORM or template engine. With support for over
  70. 14 template engines via [Consolidate.js](https://github.com/tj/consolidate.js),
  71. you can quickly craft your perfect framework.
  72. ## Examples
  73. To view the examples, clone the Express repo and install the dependencies:
  74. ```bash
  75. $ git clone git://github.com/expressjs/express.git --depth 1
  76. $ cd express
  77. $ npm install
  78. ```
  79. Then run whichever example you want:
  80. ```bash
  81. $ node examples/content-negotiation
  82. ```
  83. ## Tests
  84. To run the test suite, first install the dependencies, then run `npm test`:
  85. ```bash
  86. $ npm install
  87. $ npm test
  88. ```
  89. ## Contributing
  90. [Contributing Guide](Contributing.md)
  91. ## People
  92. The original author of Express is [TJ Holowaychuk](https://github.com/tj)
  93. The current lead maintainer is [Douglas Christopher Wilson](https://github.com/dougwilson)
  94. [List of all contributors](https://github.com/expressjs/express/graphs/contributors)
  95. ## License
  96. [MIT](LICENSE)
  97. [npm-image]: https://img.shields.io/npm/v/express.svg
  98. [npm-url]: https://npmjs.org/package/express
  99. [downloads-image]: https://img.shields.io/npm/dm/express.svg
  100. [downloads-url]: https://npmjs.org/package/express
  101. [travis-image]: https://img.shields.io/travis/expressjs/express/master.svg?label=linux
  102. [travis-url]: https://travis-ci.org/expressjs/express
  103. [appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/express/master.svg?label=windows
  104. [appveyor-url]: https://ci.appveyor.com/project/dougwilson/express
  105. [coveralls-image]: https://img.shields.io/coveralls/expressjs/express/master.svg
  106. [coveralls-url]: https://coveralls.io/r/expressjs/express?branch=master