Commit Graph

151 Commits

Author SHA1 Message Date
Wes
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 Andrejewski
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
TJ Holowaychuk
51210d6b95 Release 3.0.0rc4 2012-08-30 22:13:38 -07:00
TJ Holowaychuk
b96401ac83 Release 3.0.0rc3 2012-08-13 20:23:59 -07:00
Ritchie Martori
ba2f66d765 Removed extraneous require('http') 2012-08-08 17:51:04 -07:00
TJ Holowaychuk
20e8f08cb2 Release 3.0.0rc2 2012-08-03 13:32:53 -07:00
TJ Holowaychuk
42fd29efe8 deprecate .createServer() & remove old stale examples 2012-07-24 15:40:05 -07:00
TJ Holowaychuk
2d91eac811 Release 3.0.0rc1 2012-07-24 13:32:49 -07:00
TJ Holowaychuk
1ad2ecefe8 Release 3.0.0beta7 2012-07-16 09:25:03 -07:00