Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: expressjs/express
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3ed5090ca91f6a387e66370d57ead94d886275e1
Choose a base ref
...
head repository: expressjs/express
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3d7fce56a35f4f73fa437866cd1401587a212334
Choose a head ref
Loading
Showing with 5,164 additions and 661 deletions.
  1. +1 −1 .eslintrc.yml
  2. +161 −0 .github/workflows/ci.yml
  3. +4 −16 .gitignore
  4. +0 −39 .travis.yml
  5. +92 −0 Charter.md
  6. +139 −0 Code-Of-Conduct.md
  7. +2 −1 Collaborator-Guide.md
  8. +36 −8 Contributing.md
  9. +132 −9 History.md
  10. +16 −11 Readme.md
  11. +4 −0 Security.md
  12. +63 −0 Triager-Guide.md
  13. +81 −11 appveyor.yml
  14. +30 −0 examples/README.md
  15. +6 −3 examples/auth/index.js
  16. +2 −0 examples/auth/views/head.ejs
  17. +2 −3 examples/auth/views/login.ejs
  18. +2 −0 examples/content-negotiation/db.js
  19. +2 −0 examples/content-negotiation/index.js
  20. +1 −0 examples/content-negotiation/users.js
  21. +2 −0 examples/cookie-sessions/index.js
  22. +2 −0 examples/cookies/index.js
  23. +3 −0 examples/downloads/files/notes/groceries.txt
  24. +15 −7 examples/downloads/index.js
  25. +2 −0 examples/ejs/index.js
  26. +1 −1 examples/ejs/public/stylesheets/style.css
  27. +1 −0 examples/ejs/views/header.html
  28. +2 −2 examples/ejs/views/users.html
  29. +2 −0 examples/error-pages/index.js
  30. +2 −2 examples/error-pages/views/404.ejs
  31. +2 −2 examples/error-pages/views/500.ejs
  32. +2 −0 examples/error-pages/views/error_header.ejs
  33. +2 −0 examples/error-pages/views/index.ejs
  34. +2 −0 examples/error/index.js
  35. +3 −1 examples/hello-world/index.js
  36. +2 −0 examples/markdown/index.js
  37. +2 −0 examples/multi-router/controllers/api_v1.js
  38. +2 −0 examples/multi-router/controllers/api_v2.js
  39. +3 −1 examples/multi-router/index.js
  40. +2 −0 examples/multipart/index.js
  41. +2 −0 examples/mvc/controllers/main/index.js
  42. +2 −0 examples/mvc/controllers/pet/index.js
  43. +2 −0 examples/mvc/controllers/pet/views/edit.ejs
  44. +2 −0 examples/mvc/controllers/pet/views/show.ejs
  45. +2 −0 examples/mvc/controllers/user-pet/index.js
  46. +2 −0 examples/mvc/controllers/user/index.js
  47. +2 −0 examples/mvc/controllers/user/views/edit.hbs
  48. +2 −0 examples/mvc/controllers/user/views/list.hbs
  49. +2 −0 examples/mvc/controllers/user/views/show.hbs
  50. +2 −0 examples/mvc/db.js
  51. +2 −0 examples/mvc/index.js
  52. +2 −0 examples/mvc/lib/boot.js
  53. +1 −1 examples/mvc/public/style.css
  54. +1 −0 examples/mvc/views/404.ejs
  55. +1 −0 examples/mvc/views/5xx.ejs
  56. +1 −0 examples/online/index.js
  57. +3 −1 examples/params/index.js
  58. +3 −1 examples/resource/index.js
  59. +6 −3 examples/route-map/index.js
  60. +3 −1 examples/route-middleware/index.js
  61. +2 −0 examples/route-separation/index.js
  62. +2 −0 examples/route-separation/post.js
  63. +2 −0 examples/route-separation/site.js
  64. +2 −0 examples/route-separation/user.js
  65. +1 −0 examples/route-separation/views/header.ejs
  66. +2 −2 examples/route-separation/views/index.ejs
  67. +2 −2 examples/route-separation/views/posts/index.ejs
  68. +2 −2 examples/route-separation/views/users/edit.ejs
  69. +2 −2 examples/route-separation/views/users/index.ejs
  70. +2 −2 examples/route-separation/views/users/view.ejs
  71. +1 −0 examples/search/index.js
  72. +2 −0 examples/search/public/client.js
  73. +1 −0 examples/search/public/index.html
  74. +1 −0 examples/session/index.js
  75. +2 −0 examples/session/redis.js
  76. +2 −0 examples/static-files/index.js
  77. +1 −1 examples/static-files/public/js/app.js
  78. +2 −0 examples/vhost/index.js
  79. +2 −0 examples/view-constructor/github-view.js
  80. +2 −0 examples/view-constructor/index.js
  81. +2 −0 examples/view-locals/index.js
  82. +2 −0 examples/view-locals/user.js
  83. +1 −0 examples/view-locals/views/index.ejs
  84. +6 −4 examples/web-service/index.js
  85. +1 −1 lib/application.js
  86. +7 −3 lib/express.js
  87. +5 −1 lib/request.js
  88. +24 −14 lib/response.js
  89. +7 −1 lib/router/index.js
  90. +4 −7 lib/utils.js
  91. +37 −35 package.json
  92. +1 −0 test/Route.js
  93. +4 −3 test/Router.js
  94. +16 −1 test/acceptance/auth.js
  95. +1 −1 test/acceptance/cookie-sessions.js
  96. +17 −0 test/acceptance/downloads.js
  97. +21 −0 test/acceptance/hello-world.js
  98. +1 −1 test/acceptance/multi-router.js
  99. +3 −3 test/acceptance/web-service.js
  100. +8 −5 test/app.all.js
  101. +1 −0 test/app.del.js
  102. +8 −6 test/app.engine.js
  103. +8 −10 test/app.head.js
  104. +40 −18 test/app.js
  105. +1 −4 test/app.listen.js
  106. +9 −6 test/app.locals.js
  107. +1 −0 test/app.options.js
  108. +16 −17 test/app.param.js
  109. +28 −27 test/app.render.js
  110. +120 −0 test/app.request.js
  111. +114 −15 test/app.response.js
  112. +2 −0 test/app.route.js
  113. +62 −39 test/app.router.js
  114. +9 −6 test/app.routes.error.js
  115. +11 −9 test/app.use.js
  116. +1 −0 test/config.js
  117. +27 −0 test/exports.js
  118. +665 −0 test/express.json.js
  119. +388 −0 test/express.raw.js
  120. +814 −0 test/express.static.js
  121. +442 −0 test/express.text.js
  122. +735 −0 test/express.urlencoded.js
  123. 0 test/fixtures/empty.txt
  124. +1 −0 test/fixtures/nums.txt
  125. +1 −0 test/fixtures/pets/names.txt
  126. 0 test/fixtures/snow ☃/.gitkeep
  127. +1 −0 test/fixtures/todo.html
  128. +1 −0 test/fixtures/todo.txt
  129. +1 −0 test/fixtures/users/index.html
  130. +1 −0 test/fixtures/users/tobi.txt
  131. +3 −0 test/middleware.basic.js
  132. +0 −1 test/mocha.opts
  133. +1 −0 test/regression.js
  134. +1 −0 test/req.accepts.js
  135. +3 −2 test/req.acceptsCharset.js
  136. +3 −2 test/req.acceptsCharsets.js
  137. +19 −16 test/req.acceptsEncoding.js
  138. +20 −17 test/req.acceptsEncodings.js
  139. +29 −25 test/req.acceptsLanguage.js
  140. +29 −25 test/req.acceptsLanguages.js
  141. +1 −0 test/req.baseUrl.js
  142. +1 −0 test/req.fresh.js
  143. +1 −0 test/req.get.js
  144. +1 −0 test/req.host.js
  145. +51 −0 test/req.hostname.js
  146. +17 −1 test/req.ip.js
  147. +1 −0 test/req.ips.js
  148. +1 −0 test/req.is.js
  149. +1 −0 test/req.param.js
  150. +1 −0 test/req.path.js
  151. +1 −0 test/req.protocol.js
  152. +7 −4 test/req.query.js
  153. +1 −0 test/req.range.js
  154. +7 −4 test/req.route.js
  155. +1 −0 test/req.secure.js
  156. +1 −0 test/req.signedCookies.js
  157. +1 −0 test/req.stale.js
  158. +1 −0 test/req.subdomains.js
  159. +23 −43 test/req.xhr.js
  160. +1 −0 test/res.append.js
  161. +1 −0 test/res.attachment.js
  162. +1 −0 test/res.clearCookie.js
  163. +24 −23 test/res.cookie.js
  164. +43 −4 test/res.download.js
  165. +1 −0 test/res.format.js
  166. +1 −0 test/res.get.js
  167. +16 −0 test/res.json.js
  168. +72 −52 test/res.jsonp.js
  169. +1 −0 test/res.links.js
  170. +5 −6 test/res.locals.js
  171. +1 −0 test/res.location.js
  172. +14 −2 test/res.redirect.js
  173. +1 −0 test/res.render.js
  174. +24 −3 test/res.send.js
  175. +87 −39 test/res.sendFile.js
  176. +1 −0 test/res.sendStatus.js
  177. +1 −0 test/res.set.js
  178. +1 −0 test/res.status.js
  179. +1 −0 test/res.type.js
  180. +1 −0 test/res.vary.js
  181. +1 −1 test/support/env.js
  182. +34 −0 test/support/utils.js
  183. +20 −18 test/utils.js
2 changes: 1 addition & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -3,6 +3,6 @@ root: true
rules:
eol-last: error
eqeqeq: [error, allow-null]
indent: [error, 2, { SwitchCase: 1 }]
indent: [error, 2, { MemberExpression: "off", SwitchCase: 1 }]
no-trailing-spaces: error
no-unused-vars: [error, { vars: all, args: none, ignoreRestSiblings: true }]
161 changes: 161 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
name: ci

on:
- pull_request
- push

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
name:
- Node.js 0.10
- Node.js 0.12
- io.js 1.x
- io.js 2.x
- io.js 3.x
- Node.js 4.x
- Node.js 5.x
- Node.js 6.x
- Node.js 7.x
- Node.js 8.x
- Node.js 9.x
- Node.js 10.x
- Node.js 11.x
- Node.js 12.x
- Node.js 13.x
- Node.js 14.x

include:
- name: Node.js 0.10
node-version: "0.10"
npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0

- name: Node.js 0.12
node-version: "0.12"
npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0

- name: io.js 1.x
node-version: "1.8"
npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0

- name: io.js 2.x
node-version: "2.5"
npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0

- name: io.js 3.x
node-version: "3.3"
npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0

- name: Node.js 4.x
node-version: "4.9"
npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2

- name: Node.js 5.x
node-version: "5.12"
npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2

- name: Node.js 6.x
node-version: "6.17"
npm-i: mocha@6.2.2 nyc@14.1.1 supertest@6.1.6

- name: Node.js 7.x
node-version: "7.10"
npm-i: mocha@6.2.2 nyc@14.1.1 supertest@6.1.6

- name: Node.js 8.x
node-version: "8.17"
npm-i: mocha@7.2.0

- name: Node.js 9.x
node-version: "9.11"
npm-i: mocha@7.2.0

- name: Node.js 10.x
node-version: "10.24"
npm-i: mocha@8.4.0

- name: Node.js 11.x
node-version: "11.15"
npm-i: mocha@8.4.0

- name: Node.js 12.x
node-version: "12.22"

- name: Node.js 13.x
node-version: "13.14"

- name: Node.js 14.x
node-version: "14.19"

steps:
- uses: actions/checkout@v2

- name: Install Node.js ${{ matrix.node-version }}
shell: bash -eo pipefail -l {0}
run: |
nvm install --default ${{ matrix.node-version }}
dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH"
- name: Configure npm
run: |
npm config set loglevel error
npm config set shrinkwrap false
- name: Install npm module(s) ${{ matrix.npm-i }}
run: npm install --save-dev ${{ matrix.npm-i }}
if: matrix.npm-i != ''

- name: Remove non-test dependencies
run: npm rm --silent --save-dev connect-redis

- name: Setup Node.js version-specific dependencies
shell: bash
run: |
# eslint for linting
# - remove on Node.js < 10
if [[ "$(cut -d. -f1 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then
node -pe 'Object.keys(require("./package").devDependencies).join("\n")' | \
grep -E '^eslint(-|$)' | \
sort -r | \
xargs -n1 npm rm --silent --save-dev
fi
- name: Install Node.js dependencies
run: npm install

- name: List environment
id: list_env
shell: bash
run: |
echo "node@$(node -v)"
echo "npm@$(npm -v)"
npm -s ls ||:
(npm -s ls --depth=0 ||:) | awk -F'[ @]' 'NR>1 && $2 { print "::set-output name=" $2 "::" $3 }'
- name: Run tests
shell: bash
run: npm run test-ci

- name: Lint code
if: steps.list_env.outputs.eslint != ''
run: npm run lint

- name: Collect code coverage
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-${{ matrix.test_number }}
parallel: true

coverage:
needs: test
runs-on: ubuntu-latest
steps:
- name: Upload code coverage
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
20 changes: 4 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
# OS X
.DS_Store*
Icon?
._*

# Windows
Thumbs.db
ehthumbs.db
Desktop.ini

# Linux
.directory
*~


# npm
node_modules
package-lock.json
*.log
*.gz


# Coveralls
.nyc_output
coverage

# Benchmarking
benchmarks/graphs

# ignore additional files using core.excludesFile
# https://git-scm.com/docs/gitignore
39 changes: 0 additions & 39 deletions .travis.yml

This file was deleted.

92 changes: 92 additions & 0 deletions Charter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Express Charter

## Section 0: Guiding Principles

The Express project is part of the OpenJS Foundation which operates
transparently, openly, collaboratively, and ethically.
Project proposals, timelines, and status must not merely be open, but
also easily visible to outsiders.

## Section 1: Scope

Express is a http web server framework with a simple and expressive API
which is highly aligned with Node.js core. We aim to be the best in
class for writing performant, spec compliant, and powerful web servers
in Node.js. As one of the oldest and most popular web frameworks in
the ecosystem, we have an important place for new users and experts
alike.

### 1.1: In-scope

Express is made of many modules spread between three GitHub Orgs:

- [expressjs](http://github.com/expressjs/): Top level middleware and
libraries
- [pillarjs](http://github.com/pillarjs/): Components which make up
Express but can also be used for other web frameworks
- [jshttp](http://github.com/jshttp/): Low level http libraries

### 1.2: Out-of-Scope

Section Intentionally Left Blank

## Section 2: Relationship with OpenJS Foundation CPC.

Technical leadership for the projects within the OpenJS Foundation is
delegated to the projects through their project charters by the OpenJS
Cross Project Council (CPC). In the case of the Express project, it is
delegated to the Express Technical Committee ("TC").

This Technical Committee is in charge of both the day-to-day operations
of the project, as well as its technical management. This charter can
be amended by the TC requiring at least two approvals and a minimum two
week comment period for other TC members or CPC members to object. Any
changes the CPC wishes to propose will be considered a priority but
will follow the same process.

### 2.1 Other Formal Project Relationships

Section Intentionally Left Blank

## Section 3: Express Governing Body

The Express project is managed by the Technical Committee ("TC").
Members can be added to the TC at any time. Any committer can nominate
another committer to the TC and the TC uses its standard consensus
seeking process to evaluate whether or not to add this new member.
Members who do not participate consistently at the level of a majority
of the other members are expected to resign.

## Section 4: Roles & Responsibilities

The Express TC manages all aspects of both the technical and community
parts of the project. Members of the TC should attend the regular
meetings when possible, and be available for discussion of time
sensitive or important issues.

### Section 4.1 Project Operations & Management

Section Intentionally Left Blank

### Section 4.2: Decision-making, Voting, and/or Elections

The Express TC uses a "consensus seeking" process for issues that are
escalated to the TC. The group tries to find a resolution that has no
open objections among TC members. If a consensus cannot be reached
that has no objections then a majority wins vote is called. It is also
expected that the majority of decisions made by the TC are via a
consensus seeking process and that voting is only used as a last-resort.

Resolution may involve returning the issue to committers with
suggestions on how to move forward towards a consensus. It is not
expected that a meeting of the TC will resolve all issues on its
agenda during that meeting and may prefer to continue the discussion
happening among the committers.

### Section 4.3: Other Project Roles

Section Intentionally Left Blank

## Section 5: Definitions

Section Intentionally Left Blank
Loading