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: ef7ad681b245fba023843ce94f6bcb8e275bbb8e
Choose a base ref
...
head repository: expressjs/express
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f974d22c66d3cd91634ddaba1ef8bcaa8e49daf4
Choose a head ref
Loading
Showing with 2,692 additions and 1,203 deletions.
  1. +11 −0 .editorconfig
  2. +2 −0 .eslintignore
  3. +8 −0 .eslintrc
  4. +1 −0 .gitignore
  5. +32 −5 .travis.yml
  6. +50 −0 Collaborator-Guide.md
  7. +74 −14 Contributing.md
  8. +334 −0 History.md
  9. +125 −0 Readme-Guide.md
  10. +27 −12 Readme.md
  11. +186 −0 Release-Process.md
  12. +43 −0 Security.md
  13. +13 −3 appveyor.yml
  14. +1 −4 benchmarks/middleware.js
  15. +6 −6 examples/auth/index.js
  16. +0 −48 examples/auth/pass.js
  17. +0 −31 examples/big-view/index.js
  18. +0 −12 examples/big-view/pets.jade
  19. +1 −1 examples/content-negotiation/db.js
  20. +2 −3 examples/cookie-sessions/index.js
  21. +1 −2 examples/cookies/index.js
  22. +3 −3 examples/downloads/index.js
  23. +6 −1 examples/ejs/index.js
  24. 0 examples/{jade → ejs}/public/stylesheets/style.css
  25. +2 −7 examples/ejs/views/header.html
  26. +13 −15 examples/error-pages/index.js
  27. +3 −0 examples/error/index.js
  28. +0 −64 examples/expose-data-to-client/index.js
  29. +0 −14 examples/expose-data-to-client/views/page.jade
  30. +0 −51 examples/jade/index.js
  31. +0 −3 examples/jade/views/header.jade
  32. +0 −5 examples/jade/views/layout.jade
  33. +0 −8 examples/jade/views/users/index.jade
  34. +0 −3 examples/jade/views/users/user.jade
  35. +8 −11 examples/markdown/index.js
  36. +1 −1 examples/mvc/controllers/main/index.js
  37. +2 −0 examples/mvc/controllers/user/index.js
  38. +25 −0 examples/mvc/controllers/user/views/edit.hbs
  39. +0 −11 examples/mvc/controllers/user/views/edit.jade
  40. +16 −0 examples/mvc/controllers/user/views/list.hbs
  41. +0 −7 examples/mvc/controllers/user/views/list.jade
  42. +29 −0 examples/mvc/controllers/user/views/show.hbs
  43. +0 −17 examples/mvc/controllers/user/views/show.jade
  44. +1 −1 examples/mvc/db.js
  45. +7 −9 examples/mvc/index.js
  46. +19 −15 examples/mvc/lib/boot.js
  47. +12 −0 examples/mvc/views/404.ejs
  48. +0 −3 examples/mvc/views/404.jade
  49. +12 −0 examples/mvc/views/5xx.ejs
  50. +0 −3 examples/mvc/views/5xx.jade
  51. +5 −1 examples/online/index.js
  52. +1 −1 examples/params/index.js
  53. +1 −1 examples/resource/index.js
  54. +5 −5 examples/route-separation/index.js
  55. +1 −1 examples/route-separation/site.js
  56. +2 −0 examples/route-separation/views/footer.ejs
  57. +8 −0 examples/route-separation/views/header.ejs
  58. +10 −0 examples/route-separation/views/index.ejs
  59. +0 −6 examples/route-separation/views/index.jade
  60. +0 −6 examples/route-separation/views/layout.jade
  61. +12 −0 examples/route-separation/views/posts/index.ejs
  62. +0 −8 examples/route-separation/views/posts/index.jade
  63. +23 −0 examples/route-separation/views/users/edit.ejs
  64. +0 −12 examples/route-separation/views/users/edit.jade
  65. +14 −0 examples/route-separation/views/users/index.ejs
  66. +0 −9 examples/route-separation/views/users/index.jade
  67. +9 −0 examples/route-separation/views/users/view.ejs
  68. +0 −6 examples/route-separation/views/users/view.jade
  69. +8 −12 examples/search/index.js
  70. +1 −1 examples/search/{ → public}/client.js
  71. +20 −0 examples/search/public/index.html
  72. +0 −15 examples/search/search.jade
  73. +5 −1 examples/session/index.js
  74. +4 −3 examples/static-files/index.js
  75. +1 −1 examples/static-files/public/js/app.js
  76. +1 −1 examples/view-constructor/github-view.js
  77. +2 −3 examples/view-constructor/index.js
  78. +6 −5 examples/view-locals/index.js
  79. +0 −12 examples/view-locals/layout.jade
  80. +0 −8 examples/view-locals/user.jade
  81. +3 −0 examples/view-locals/user.js
  82. +19 −0 examples/view-locals/views/index.ejs
  83. +2 −2 examples/web-service/index.js
  84. +12 −11 lib/application.js
  85. +14 −5 lib/express.js
  86. +9 −2 lib/middleware/init.js
  87. +5 −9 lib/middleware/query.js
  88. +53 −25 lib/request.js
  89. +118 −34 lib/response.js
  90. +38 −21 lib/router/index.js
  91. +26 −21 lib/router/layer.js
  92. +10 −4 lib/router/route.js
  93. +26 −20 lib/utils.js
  94. +11 −2 lib/view.js
  95. +46 −39 package.json
  96. +12 −8 test/Route.js
  97. +68 −10 test/Router.js
  98. +3 −3 test/acceptance/cookie-sessions.js
  99. +7 −12 test/acceptance/cookies.js
  100. +2 −5 test/acceptance/downloads.js
  101. +1 −1 test/acceptance/error-pages.js
  102. +1 −1 test/acceptance/error.js
  103. +2 −2 test/acceptance/params.js
  104. +1 −1 test/acceptance/route-map.js
  105. +1 −1 test/acceptance/web-service.js
  106. +7 −6 test/app.engine.js
  107. +2 −2 test/app.js
  108. +0 −1 test/app.listen.js
  109. +0 −1 test/app.locals.js
  110. +1 −1 test/app.options.js
  111. +7 −8 test/app.param.js
  112. +35 −24 test/app.render.js
  113. +60 −6 test/app.router.js
  114. +4 −4 test/app.routes.error.js
  115. +22 −9 test/app.use.js
  116. +6 −6 test/config.js
  117. +4 −4 test/exports.js
  118. 0 test/fixtures/broken.send
  119. +2 −7 test/middleware.basic.js
  120. +5 −5 test/req.acceptsEncoding.js
  121. +5 −5 test/req.acceptsEncodings.js
  122. +8 −8 test/req.acceptsLanguage.js
  123. +8 −8 test/req.acceptsLanguages.js
  124. +1 −1 test/req.fresh.js
  125. +25 −1 test/req.get.js
  126. +0 −1 test/req.host.js
  127. +0 −1 test/req.hostname.js
  128. +2 −2 test/req.ip.js
  129. +139 −74 test/req.is.js
  130. +1 −2 test/req.param.js
  131. +4 −4 test/req.query.js
  132. +89 −24 test/req.range.js
  133. +1 −5 test/req.signedCookies.js
  134. +1 −1 test/req.stale.js
  135. +4 −4 test/req.xhr.js
  136. +2 −1 test/res.attachment.js
  137. +4 −10 test/res.clearCookie.js
  138. +24 −20 test/res.cookie.js
  139. +80 −1 test/res.download.js
  140. +0 −1 test/res.format.js
  141. +22 −0 test/res.json.js
  142. +25 −5 test/res.jsonp.js
  143. +85 −3 test/res.location.js
  144. +50 −42 test/res.redirect.js
  145. +47 −24 test/res.render.js
  146. +46 −56 test/res.send.js
  147. +104 −42 test/res.sendFile.js
  148. +0 −1 test/res.sendStatus.js
  149. +13 −0 test/res.set.js
  150. +2 −1 test/res.type.js
  151. +3 −9 test/res.vary.js
  152. +1 −0 test/support/tmpl.js
  153. +24 −0 test/support/utils.js
  154. +12 −12 test/utils.js
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# http://editorconfig.org
root = true

[*]
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true

[{*.js,*.json,*.yml}]
indent_size = 2
indent_style = space
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage
node_modules
8 changes: 8 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"rules": {
"eol-last": "error",
"indent": ["error", 2, { "SwitchCase": 1 }],
"no-trailing-spaces": "error",
"no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": true }]
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ Desktop.ini

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

37 changes: 32 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -2,11 +2,38 @@ language: node_js
node_js:
- "0.10"
- "0.12"
- "1.0"
- "1.8"
- "2.0"
- "2.3"
- "2.5"
- "3.3"
- "4.8"
- "5.12"
- "6.11"
- "7.10"
- "8.4"
matrix:
include:
- node_js: "8"
env: "NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly"
- node_js: "9"
env: "NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly"
allow_failures:
# Allow the nightly installs to fail
- env: "NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly"
sudo: false
before_install: "npm rm --save-dev connect-redis"
script: "npm run-script test-ci"
cache:
directories:
- node_modules
before_install:
# Skip updating shrinkwrap / lock
- "npm config set shrinkwrap false"

# Remove all non-test dependencies
- "npm rm --save-dev connect-redis"

# Update Node.js modules
- "test ! -d node_modules || npm prune"
- "test ! -d node_modules || npm rebuild"
script:
- "npm run test-ci"
- "npm run lint"
after_script: "npm install coveralls@2.10.0 && cat ./coverage/lcov.info | coveralls"
50 changes: 50 additions & 0 deletions Collaborator-Guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@

## Website Issues

Open issues for the expressjs.com website in https://github.com/expressjs/expressjs.com.

## PRs and Code contributions

* Tests must pass.
* Follow the [JavaScript Standard Style](http://standardjs.com/) and `npm run lint`.
* If you fix a bug, add a test.

## Branches

Use the `master` branch for bug fixes or minor work that is intended for the
current release stream.

Use the correspondingly named branch, e.g. `5.0`, for anything intended for
a future release of Express.

## Steps for contributing

1. [Create an issue](https://github.com/expressjs/express/issues/new) for the
bug you want to fix or the feature that you want to add.
2. Create your own [fork](https://github.com/expressjs/express) on github, then
checkout your fork.
3. Write your code in your local copy. It's good practice to create a branch for
each new issue you work on, although not compulsory.
4. To run the test suite, first install the dependencies by running `npm install`,
then run `npm test`.
5. Ensure your code is linted by running `npm run lint` -- fix any issue you
see listed.
6. If the tests pass, you can commit your changes to your fork and then create
a pull request from there. Make sure to reference your issue from the pull
request comments by including the issue number e.g. `#123`.

## Issues which are questions

We will typically close any vague issues or questions that are specific to some
app you are writing. Please double check the docs and other references before
being trigger happy with posting a question issue.

Things that will help get your question issue looked at:

* Full and runnable JS code.
* Clear description of the problem or unexpected behavior.
* Clear description of the expected result.
* Steps you have taken to debug it yourself.

If you post a question and do not outline the above items or make it easy for
us to understand and reproduce your issue, it will be closed.
88 changes: 74 additions & 14 deletions Contributing.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,85 @@
# Express.js Community Contributing Guide 1.0

## Website Issues
The goal of this document is to create a contribution process that:

Issues for the expressjs.com website go here https://github.com/strongloop/expressjs.com
* Encourages new contributions.
* Encourages contributors to remain involved.
* Avoids unnecessary processes and bureaucracy whenever possible.
* Creates a transparent decision making process that makes it clear how
contributors can be involved in decision making.

## PRs and Code contributions
## Vocabulary

* Tests must pass.
* Follow existing coding style.
* If you fix a bug, add a test.
* A **Contributor** is any individual creating or commenting on an issue or pull request.
* A **Committer** is a subset of contributors who have been given write access to the repository.
* A **TC (Technical Committee)** is a group of committers representing the required technical
expertise to resolve rare disputes.

# Logging Issues

## Issues which are questions
Log an issue for any question or problem you might have. When in doubt, log an issue, and
any additional policies about what to include will be provided in the responses. The only
exception is security dislosures which should be sent privately.

We will typically close any vague issues or questions that are specific to some app you are writing. Please double check the docs and other references before being trigger happy with posting a question issue.
Committers may direct you to another repository, ask for additional clarifications, and
add appropriate metadata before the issue is addressed.

Things that will help get your question issue looked at:
Please be courteous and respectful. Every participant is expected to follow the
project's Code of Conduct.

* Full and runnable JS code.
* Clear description of the problem or unexpected behavior.
* Clear description of the expected result.
* Steps you have taken to debug it yourself.
# Contributions

Any change to resources in this repository must be through pull requests. This applies to all changes
to documentation, code, binary files, etc. Even long term committers and TC members must use
pull requests.

No pull request can be merged without being reviewed.

For non-trivial contributions, pull requests should sit for at least 36 hours to ensure that
contributors in other timezones have time to review. Consideration should also be given to
weekends and other holiday periods to ensure active committers all have reasonable time to
become involved in the discussion and review process if they wish.

The default for each contribution is that it is accepted once no committer has an objection.
During review committers may also request that a specific contributor who is most versed in a
particular area gives a "LGTM" before the PR can be merged. There is no additional "sign off"
process for contributions to land. Once all issues brought by committers are addressed it can
be landed by any committer.

In the case of an objection being raised in a pull request by another committer, all involved
committers should seek to arrive at a consensus by way of addressing concerns being expressed
by discussion, compromise on the proposed change, or withdrawal of the proposed change.

If a contribution is controversial and committers cannot agree about how to get it to land
or if it should land then it should be escalated to the TC. TC members should regularly
discuss pending contributions in order to find a resolution. It is expected that only a
small minority of issues be brought to the TC for resolution and that discussion and
compromise among committers be the default resolution mechanism.

# Becoming a Committer

All contributors who land a non-trivial contribution should be on-boarded in a timely manner,
and added as a committer, and be given write access to the repository.

Committers are expected to follow this policy and continue to send pull requests, go through
proper review, and have other committers merge their pull requests.

# TC Process

The 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.

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.

If you post a question and do not outline the above items or make it easy for us to understand and reproduce your issue, it will be closed.

Loading