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.

260 lines
9.6 KiB

3 months ago
  1. [![Express Logo](https://i.cloudup.com/zfY6lL7eFa-3000x3000.png)](http://expressjs.com/)
  2. **Fast, unopinionated, minimalist web framework for [Node.js](http://nodejs.org).**
  3. **This project has a [Code of Conduct][].**
  4. ## Table of contents
  5. * [Installation](#Installation)
  6. * [Features](#Features)
  7. * [Docs & Community](#docs--community)
  8. * [Quick Start](#Quick-Start)
  9. * [Running Tests](#Running-Tests)
  10. * [Philosophy](#Philosophy)
  11. * [Examples](#Examples)
  12. * [Contributing to Express](#Contributing)
  13. * [TC (Technical Committee)](#tc-technical-committee)
  14. * [Triagers](#triagers)
  15. * [License](#license)
  16. [![NPM Version][npm-version-image]][npm-url]
  17. [![NPM Install Size][npm-install-size-image]][npm-install-size-url]
  18. [![NPM Downloads][npm-downloads-image]][npm-downloads-url]
  19. [![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer]
  20. ```js
  21. const express = require('express')
  22. const app = express()
  23. app.get('/', function (req, res) {
  24. res.send('Hello World')
  25. })
  26. app.listen(3000)
  27. ```
  28. ## Installation
  29. This is a [Node.js](https://nodejs.org/en/) module available through the
  30. [npm registry](https://www.npmjs.com/).
  31. Before installing, [download and install Node.js](https://nodejs.org/en/download/).
  32. Node.js 0.10 or higher is required.
  33. If this is a brand new project, make sure to create a `package.json` first with
  34. the [`npm init` command](https://docs.npmjs.com/creating-a-package-json-file).
  35. Installation is done using the
  36. [`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
  37. ```console
  38. $ npm install express
  39. ```
  40. Follow [our installing guide](http://expressjs.com/en/starter/installing.html)
  41. for more information.
  42. ## Features
  43. * Robust routing
  44. * Focus on high performance
  45. * Super-high test coverage
  46. * HTTP helpers (redirection, caching, etc)
  47. * View system supporting 14+ template engines
  48. * Content negotiation
  49. * Executable for generating applications quickly
  50. ## Docs & Community
  51. * [Website and Documentation](http://expressjs.com/) - [[website repo](https://github.com/expressjs/expressjs.com)]
  52. * [#express](https://web.libera.chat/#express) on [Libera Chat](https://libera.chat) IRC
  53. * [GitHub Organization](https://github.com/expressjs) for Official Middleware & Modules
  54. * Visit the [Wiki](https://github.com/expressjs/express/wiki)
  55. * [Google Group](https://groups.google.com/group/express-js) for discussion
  56. * [Gitter](https://gitter.im/expressjs/express) for support and discussion
  57. **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).
  58. ## Quick Start
  59. 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:
  60. Install the executable. The executable's major version will match Express's:
  61. ```console
  62. $ npm install -g express-generator@4
  63. ```
  64. Create the app:
  65. ```console
  66. $ express /tmp/foo && cd /tmp/foo
  67. ```
  68. Install dependencies:
  69. ```console
  70. $ npm install
  71. ```
  72. Start the server:
  73. ```console
  74. $ npm start
  75. ```
  76. View the website at: http://localhost:3000
  77. ## Philosophy
  78. The Express philosophy is to provide small, robust tooling for HTTP servers, making
  79. it a great solution for single page applications, websites, hybrids, or public
  80. HTTP APIs.
  81. Express does not force you to use any specific ORM or template engine. With support for over
  82. 14 template engines via [Consolidate.js](https://github.com/tj/consolidate.js),
  83. you can quickly craft your perfect framework.
  84. ## Examples
  85. To view the examples, clone the Express repo and install the dependencies:
  86. ```console
  87. $ git clone https://github.com/expressjs/express.git --depth 1
  88. $ cd express
  89. $ npm install
  90. ```
  91. Then run whichever example you want:
  92. ```console
  93. $ node examples/content-negotiation
  94. ```
  95. ## Contributing
  96. [![Linux Build][github-actions-ci-image]][github-actions-ci-url]
  97. [![Windows Build][appveyor-image]][appveyor-url]
  98. [![Test Coverage][coveralls-image]][coveralls-url]
  99. The Express.js project welcomes all constructive contributions. Contributions take many forms,
  100. from code for bug fixes and enhancements, to additions and fixes to documentation, additional
  101. tests, triaging incoming pull requests and issues, and more!
  102. See the [Contributing Guide](Contributing.md) for more technical details on contributing.
  103. ### Security Issues
  104. If you discover a security vulnerability in Express, please see [Security Policies and Procedures](Security.md).
  105. ### Running Tests
  106. To run the test suite, first install the dependencies, then run `npm test`:
  107. ```console
  108. $ npm install
  109. $ npm test
  110. ```
  111. ## People
  112. The original author of Express is [TJ Holowaychuk](https://github.com/tj)
  113. [List of all contributors](https://github.com/expressjs/express/graphs/contributors)
  114. ### TC (Technical Committee)
  115. * [UlisesGascon](https://github.com/UlisesGascon) - **Ulises Gascón** (he/him)
  116. * [jonchurch](https://github.com/jonchurch) - **Jon Church**
  117. * [wesleytodd](https://github.com/wesleytodd) - **Wes Todd**
  118. * [LinusU](https://github.com/LinusU) - **Linus Unnebäck**
  119. * [blakeembrey](https://github.com/blakeembrey) - **Blake Embrey**
  120. * [sheplu](https://github.com/sheplu) - **Jean Burellier**
  121. * [crandmck](https://github.com/crandmck) - **Rand McKinney**
  122. * [ctcpip](https://github.com/ctcpip) - **Chris de Almeida**
  123. <details>
  124. <summary>TC emeriti members</summary>
  125. #### TC emeriti members
  126. * [dougwilson](https://github.com/dougwilson) - **Douglas Wilson**
  127. * [hacksparrow](https://github.com/hacksparrow) - **Hage Yaapa**
  128. * [jonathanong](https://github.com/jonathanong) - **jongleberry**
  129. * [niftylettuce](https://github.com/niftylettuce) - **niftylettuce**
  130. * [troygoode](https://github.com/troygoode) - **Troy Goode**
  131. </details>
  132. ### Triagers
  133. * [aravindvnair99](https://github.com/aravindvnair99) - **Aravind Nair**
  134. * [carpasse](https://github.com/carpasse) - **Carlos Serrano**
  135. * [CBID2](https://github.com/CBID2) - **Christine Belzie**
  136. * [enyoghasim](https://github.com/enyoghasim) - **David Enyoghasim**
  137. * [UlisesGascon](https://github.com/UlisesGascon) - **Ulises Gascón** (he/him)
  138. * [mertcanaltin](https://github.com/mertcanaltin) - **Mert Can Altin**
  139. * [0ss](https://github.com/0ss) - **Salah**
  140. * [import-brain](https://github.com/import-brain) - **Eric Cheng** (he/him)
  141. * [3imed-jaberi](https://github.com/3imed-jaberi) - **Imed Jaberi**
  142. * [dakshkhetan](https://github.com/dakshkhetan) - **Daksh Khetan** (he/him)
  143. * [lucasraziel](https://github.com/lucasraziel) - **Lucas Soares Do Rego**
  144. * [IamLizu](https://github.com/IamLizu) - **S M Mahmudul Hasan** (he/him)
  145. * [Sushmeet](https://github.com/Sushmeet) - **Sushmeet Sunger**
  146. <details>
  147. <summary>Triagers emeriti members</summary>
  148. #### Emeritus Triagers
  149. * [AuggieH](https://github.com/AuggieH) - **Auggie Hudak**
  150. * [G-Rath](https://github.com/G-Rath) - **Gareth Jones**
  151. * [MohammadXroid](https://github.com/MohammadXroid) - **Mohammad Ayashi**
  152. * [NawafSwe](https://github.com/NawafSwe) - **Nawaf Alsharqi**
  153. * [NotMoni](https://github.com/NotMoni) - **Moni**
  154. * [VigneshMurugan](https://github.com/VigneshMurugan) - **Vignesh Murugan**
  155. * [davidmashe](https://github.com/davidmashe) - **David Ashe**
  156. * [digitaIfabric](https://github.com/digitaIfabric) - **David**
  157. * [e-l-i-s-e](https://github.com/e-l-i-s-e) - **Elise Bonner**
  158. * [fed135](https://github.com/fed135) - **Frederic Charette**
  159. * [firmanJS](https://github.com/firmanJS) - **Firman Abdul Hakim**
  160. * [getspooky](https://github.com/getspooky) - **Yasser Ameur**
  161. * [ghinks](https://github.com/ghinks) - **Glenn**
  162. * [ghousemohamed](https://github.com/ghousemohamed) - **Ghouse Mohamed**
  163. * [gireeshpunathil](https://github.com/gireeshpunathil) - **Gireesh Punathil**
  164. * [jake32321](https://github.com/jake32321) - **Jake Reed**
  165. * [jonchurch](https://github.com/jonchurch) - **Jon Church**
  166. * [lekanikotun](https://github.com/lekanikotun) - **Troy Goode**
  167. * [marsonya](https://github.com/marsonya) - **Lekan Ikotun**
  168. * [mastermatt](https://github.com/mastermatt) - **Matt R. Wilson**
  169. * [maxakuru](https://github.com/maxakuru) - **Max Edell**
  170. * [mlrawlings](https://github.com/mlrawlings) - **Michael Rawlings**
  171. * [rodion-arr](https://github.com/rodion-arr) - **Rodion Abdurakhimov**
  172. * [sheplu](https://github.com/sheplu) - **Jean Burellier**
  173. * [tarunyadav1](https://github.com/tarunyadav1) - **Tarun yadav**
  174. * [tunniclm](https://github.com/tunniclm) - **Mike Tunnicliffe**
  175. </details>
  176. ## License
  177. [MIT](LICENSE)
  178. [appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/express/master?label=windows
  179. [appveyor-url]: https://ci.appveyor.com/project/dougwilson/express
  180. [coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/express/master
  181. [coveralls-url]: https://coveralls.io/r/expressjs/express?branch=master
  182. [github-actions-ci-image]: https://badgen.net/github/checks/expressjs/express/master?label=linux
  183. [github-actions-ci-url]: https://github.com/expressjs/express/actions/workflows/ci.yml
  184. [npm-downloads-image]: https://badgen.net/npm/dm/express
  185. [npm-downloads-url]: https://npmcharts.com/compare/express?minimal=true
  186. [npm-install-size-image]: https://badgen.net/packagephobia/install/express
  187. [npm-install-size-url]: https://packagephobia.com/result?p=express
  188. [npm-url]: https://npmjs.org/package/express
  189. [npm-version-image]: https://badgen.net/npm/v/express
  190. [ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/expressjs/express/badge
  191. [ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/expressjs/express
  192. [Code of Conduct]: https://github.com/expressjs/express/blob/master/Code-Of-Conduct.md