158 Commits
Author SHA1 Message Date
Szymon ŁągiewkaandWes Todd 4199d3218f fix(refactor): prefix built-in node module imports
Since v5 relies on node >= 18, this is now possible (since v16, v14.18.0
[^1][^2]).

It's functionally irrelevant:
1. It's not required for CJS nor ESM (with a few exceptions [^3])
2. It has no performance promises

However, there are upsides to this approach:
1. It brings clear boundaries to what's a built-in and what's an
external dependency
2. It reduces the risk of importing unwanted deps where a built-in is
expected
3. It's slightly more interoperable with other JS runtimes that provide
node compatibility[^4], albeit only during development. Once imported
from npm, built-ins are assumed.

[^1]:https://nodejs.org/docs/latest-v22.x/api/modules.html#built-in-modules
[^2]:https://github.com/nodejs/node/pull/37246
[^3]:https://nodejs.org/api/modules.html#built-in-modules-with-mandatory-node-prefix
[^4]:https://docs.deno.com/runtime/fundamentals/node/#using-node's-built-in-modules
2025-01-10 11:53:44 -06:00
Douglas Christopher Wilson 121fe9982b Merge tag '4.17.1' 2019-06-08 19:43:21 -04:00
Ilya GutermanandDouglas Christopher Wilson 7f4e37f3ea Add express.text to parse bodies into string
closes #3455
2019-05-08 23:39:16 -04:00
Amit ZurandDouglas Christopher Wilson 0bcdd88dd0 Add express.raw to parse bodies into Buffer
closes #3708
2019-05-08 00:57:02 -04:00
Linus UnnebäckandDouglas Christopher Wilson 431f65305e lint: move removed middlewares list to a variable
closes #3558
closes #3677
closes #3678
2018-09-13 18:46:45 -04:00
Douglas Christopher Wilson 62e12fe710 Merge tag '4.16.2' 2017-10-13 22:27:30 -04:00
Douglas Christopher Wilson c0136d8b48 Add express.json and express.urlencoded to parse bodies
closes #2211
2017-09-28 13:22:36 -04:00
WesandDouglas Christopher Wilson 06f423d4f5 Remove Express 3.x middleware error stubs
closes #3217
2017-03-01 18:29:48 -05:00
Douglas Christopher Wilson 501e24e0a9 Merge tag '4.15.0' 2017-03-01 18:17:04 -05:00
Douglas Christopher Wilson 12ff56e1e4 Use Object.create to setup request & response prototypes 2017-02-23 01:52:49 -05:00
Douglas Christopher Wilson cec5780db4 Use router module for routing
closes #2411
2015-07-06 23:46:00 -04:00
Douglas Christopher Wilson b309b873f1 Merge tag '4.13.1' 2015-07-06 16:13:54 -04:00
Douglas Christopher Wilson e71014f522 perf: enable strict mode 2015-06-18 23:01:18 -04:00
Douglas Christopher Wilson 95ad276cad docs: add license comments 2015-06-18 23:00:20 -04:00
Douglas Christopher Wilson f90e045334 Merge tag '4.12.4' 2015-05-18 00:41:42 -04:00
Douglas Christopher Wilson 31cb541b88 Fix constructing application with non-configurable prototype properties
fixes #2561
2015-03-01 16:33:09 -05:00
Douglas Christopher Wilson dcc4eaabe8 Change req.query to a getter 2014-11-06 20:18:48 -05:00
Douglas Christopher Wilson ccc45a74f8 Merge tag '3.18.1' 2014-10-23 02:06:20 -04:00
Douglas Christopher Wilson af1043844f Fix internal utils.merge deprecation warnings 2014-10-22 15:18:10 -04:00
Douglas Christopher Wilson 9c731f1883 deprecate things with depd module 2014-06-19 23:34:58 -04:00
Douglas Christopher Wilson 8dc4ff26f9 Add standard deprecation utility
* deprecations ignore when NODE_ENV=test
 * uses node.js util.deprecate
2014-05-08 19:01:16 -04:00
Chris AndrejewskiandDouglas Christopher Wilson 79cc5a4d27 make old middleware properties configurable
closes #2054
2014-04-16 08:49:08 -04:00
Kent C. Dodds 001c9380be Tell me what I'm using that isn't allowed
I'm migrating and it would be useful in a large application to know what I'm using that's not allowed. I think lots of people would feel this way. Let me know if you would prefer a different implementation.
2014-03-28 06:19:29 -06:00
agchou 13475977af some code cleanup 2014-03-25 15:23:04 -07:00
Jonathan Ong 5572897998 some jshint cleanup
some more errors but whatever
2014-03-05 22:24:35 -08:00
Jonathan Ong 3112f92d08 move the patch to the response proto 2014-03-05 22:20:58 -08:00
Jonathan Ong 9ea18e10c9 throw errors when users try to access removed middleware 2014-03-05 22:13:54 -08:00
Jonathan Ong 6ec1904aac use serve-static for static middleware 2014-03-05 21:58:49 -08:00
Roman Shtylman 1396e0855d remove last pieces of connect dependency
- copy over patch.js to shim ServerResponse
- bundle `static` middleware
2014-02-22 09:26:29 -05:00
Roman Shtylman f41d09a3cf remove app.router and refactor middleware processing
This is an overhaul of middleware processing, Router and Route. Connect is no
longer used to process the middleware stack. This functionality has been
split into two parts: middleware stack and default error response.

The entry point for request processing is the `app.handle` method. It
sets up the default error response handle (to run in the event of no
other error handler) and then triggers the app router (instance of
Router) to handle the request.

The app router `handle` function contains the middleware dispatch layer
previously in the connect codebase. This layer handle the logic for
dispatching `.use` calls (stripping paths if needed). The app contains a
base router `app._router`. New routes can be created and `.use`d on this
router to organize routes into files.

Routers now have the following methods `.use`, `.all`, `.param` which
are all public.

Additionally, Routers have a `.route(path)` method which returns a new
instance of Route for the requested path. Route(s) are isolated
middleware stacks and contain methods for the HTTP verbs as well as an
`.all` method to act similar to middleware. These methods are chainable
to easily describe requirements for a route.

  var route = Router.route('/foo'); // or 'app.route('/foo')'

  route
  .all(auth)
  .get(function(...) {})
  .all(more_checks)
  .post(function(...) {})

Any Route and Router methods which accept handlers also accept error
(arity 4) handlers which will also behave as expected.

Finally, the `app.router` getter has been removed. Middleware and
handlers are run IN THE ORDER they are seen in the file. This means that
code which injected the `app.router` and then added error handlers (or
other middleware) will need to be updated to move those handlers after
any requests added on the app object. The examples have been updated
accordingly. This is the largest breaking change to codebases in this
commit.
2014-02-03 15:59:52 -05:00
Roman Shtylman 718e68ffae use utils-merge module to mixin object properties 2014-01-24 19:16:37 -05:00
Roman Shtylman f56a5f01c4 remove deprecated express.createServer() method
This has been warning about deprecation for a long time. Use `express()`
to instantiate an express app.
2014-01-19 14:05:12 -05:00
Jonathan Ong 2e68ddbae9 expose connect.middleware using Object.getOwnPropertyDescriptor()
closes #1853. no tests, but it should be fine.
2013-12-10 23:52:48 -08:00
TJ Holowaychuk ba5c48aa86 remove .version export 2013-06-27 08:38:53 -07:00
Max Melentiev a3c9eacaf1 move .app to req's & res's prototypes 2013-06-11 19:42:30 +04:00
TJ Holowaychuk 2fe46b3905 Release 3.2.5 2013-05-21 21:01:24 -07:00
TJ Holowaychuk f976625281 Release 3.2.4 2013-05-09 09:17:48 -07:00
TJ Holowaychuk 0b09c8981f Release 3.2.3 2013-05-07 07:55:06 -07:00
TJ Holowaychuk f862ad29f5 Release 3.2.2 2013-05-03 12:54:52 -07:00
TJ Holowaychuk 0d40c65b7f Release 3.2.0 2013-04-15 12:34:41 -07:00
TJ Holowaychuk 776ee26bc3 Release 3.1.2 2013-04-12 12:14:02 -07:00
TJ Holowaychuk 476fba3e8b Release 3.1.1 2013-04-01 11:25:58 -07:00
TJ Holowaychuk d853c833f0 Release 3.1.0 2013-01-25 20:28:58 -08:00
TJ Holowaychuk 33eaa8329c Release 3.0.5 2012-12-19 13:46:16 -08:00
TJ Holowaychuk b709009bc9 Release 3.0.3 2012-11-13 09:14:13 -08:00
TJ Holowaychuk 72b9e48331 Release 3.0.2 2012-11-08 09:15:59 -08:00
TJ Holowaychuk eba6aa1767 fix .version 2012-11-08 09:15:24 -08:00
TJ Holowaychuk 12d97169d7 Release 3.0.0 2012-10-23 15:29:20 -07:00
TJ Holowaychuk 02b9d0b2e6 fix express.mime reference, should be connect.mime 2012-10-09 18:59:44 -07:00
TJ Holowaychuk 968e8f0121 Release 3.0.0rc5 2012-09-18 11:48:20 -07:00