Commit Graph
22 Commits
Author SHA1 Message Date
Rakesh BishtandDouglas Christopher Wilson 3c1d605da7 lint: remove unused parameters in examples
closes #5113
2023-02-22 10:25:07 -05:00
Thomas StraußandDouglas Christopher Wilson 884657d546 examples: remove bitwise syntax for includes check
closes #4814
2022-02-07 22:58:44 -05:00
Douglas Christopher Wilson 20047bb6e4 examples: use strict mode 2022-02-02 01:30:51 -05:00
Aalaap GhagandDouglas Christopher Wilson 21cf522dcd examples: improve 404 message wording
closes #4471
2021-12-16 13:00:12 -05:00
Douglas Christopher Wilson de081eb70f build: [email protected] 2021-09-01 19:27:00 -04:00
Andrew HeaneyandDouglas Christopher Wilson 821b7f0624 examples: fix typo in comment
closes #4667
2021-08-11 20:39:01 -04:00
Steven AnthonyandDouglas Christopher Wilson 80e64691e1 examples: add full urls to web-service example
closes #3519
2018-02-13 16:50:13 -05:00
Yaman JainandDouglas Christopher Wilson 53bee2506d examples: use https github url
closes #3465
2018-01-02 19:05:52 -05:00
Douglas Christopher Wilson 56e90e3c72 lint: add eslint rules that cover editorconfig 2017-08-05 23:37:39 -04:00
Douglas Christopher Wilson e7a02f6a25 build: move repository to expressjs 2016-01-21 20:59:53 -05:00
Douglas Christopher Wilson 6bc7574ab5 docs: typo fixes
closes #2316
2014-09-08 23:53:21 -04:00
Douglas Christopher Wilson 9eafaa23d8 Merge tag '3.16.7' 2014-08-18 22:54:25 -04:00
Raymond FengandDouglas Christopher Wilson d7bef52591 build: move repository
closes #2268
closes #2270
2014-08-18 22:07:35 -04:00
Douglas Christopher Wilson e8f8ea7e05 docs: update examples for deprecations 2014-08-06 18:13:54 -04:00
Douglas Christopher Wilson db4448dda8 Merge tag '3.9.0' 2014-05-30 22:17:51 -04:00
Douglas Christopher Wilson c18c2a8e68 tests: exclude untestable lines in examples from coverage 2014-05-28 00:07:27 -04:00
agchou 06dcb22ae2 clean up code consistency 2014-03-27 09:15:27 -07: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
TJ Holowaychuk f6ca25edbe web-service acceptance tests 2011-12-17 12:44:55 -08:00
Tj Holowaychuk c35cd7fcb7 Changed res.{send,json}() status code to the first arg at all times 2011-08-04 13:30:12 -07:00
Tj Holowaychuk e4342a7097 Added error handling to web-service example 2011-06-28 08:49:43 -07:00
Tj Holowaychuk fda31b75f9 Added simple web-service example 2011-06-23 09:45:19 -07:00