Commit Graph

74 Commits

Author SHA1 Message Date
김정환
b9b1b19758 tests: fix typos in descriptions
closes #3875
2019-04-16 12:40:59 -04:00
Douglas Christopher Wilson
d0421ac7e1 tests: use supertest to perform assertions 2018-10-26 23:34:00 -04:00
Douglas Christopher Wilson
451ee5d9c1 build: supertest@3.3.0 2018-09-24 23:40:21 -04:00
Alejandro Estrada
40e04ec7a6 lint: remove usages of "=="
closes #3540
2018-02-13 19:30:57 -05:00
Douglas Christopher Wilson
e0066227f7 lint: remove all unused varaibles 2017-08-06 00:19:32 -04:00
Douglas Christopher Wilson
dc8acc8676 tests: use supertest expect for simple assertions 2017-03-05 00:04:47 -05:00
Blake Embrey
9722202df9 Add next("router") to exit from router
closes #2241
closes #2371
2017-02-26 14:38:05 -05:00
Douglas Christopher Wilson
1f71fae23b tests: add lone "*" route tests 2017-02-26 13:21:18 -05:00
Douglas Christopher Wilson
92c859dd05 deps: finalhandler@~1.0.0 2017-02-20 21:24:54 -05:00
Sebastian Van Sande
abd1de73c1 tests: fix misnamed app.router test section
fixes #3194
closes #3199
2017-02-07 19:42:35 -05:00
Vishvajit Pathak
bd47aeb88d tests: fix typos in test descriptions
closes #3129
closes #3130
2016-11-18 13:47:28 -05:00
Douglas Christopher Wilson
11a77a3fff Fix inner numeric indices incorrectly altering parent req.params 2015-08-03 01:01:16 -04:00
Douglas Christopher Wilson
ee90042d0c Fix infinite loop condition using mergeParams: true 2015-08-03 00:50:48 -04:00
Blake Embrey
e33c5035bb deps: path-to-regexp@0.1.7
closes #2717
2015-07-31 16:58:57 -04:00
Blake Embrey
60e2008dee deps: path-to-regexp@0.1.6
fixes #2491
fixes #2617
closes #2637
closes #2683
2015-06-19 09:59:33 -04:00
Douglas Christopher Wilson
41f8435d32 tests: fix failing test on Node.js 0.11.15 2015-01-21 03:28:57 -05:00
Douglas Christopher Wilson
94f10c26cb Fix using same param name in array of paths
fixes #2389
2014-10-10 16:31:09 -04:00
Douglas Christopher Wilson
6bc7574ab5 docs: typo fixes
closes #2316
2014-09-08 23:53:21 -04:00
Douglas Christopher Wilson
ec5b9f5c61 tests: add test for error handler in route
closes #2228
2014-07-11 09:35:20 -04:00
Douglas Christopher Wilson
ef497fdae4 tests: add mounting to strict routing test 2014-07-07 23:25:05 -04:00
Douglas Christopher Wilson
23a49ff61e Fix routing regression when altering req.method 2014-07-06 19:44:43 -04:00
Douglas Christopher Wilson
fd35351594 Add mergeParams option to Router
fixes #2153
fixes #2203
2014-07-03 01:13:09 -04:00
Douglas Christopher Wilson
b89a597029 Restore req.params after invoking Router
fixes #2163
2014-06-22 12:02:36 -04:00
Douglas Christopher Wilson
5019f38e29 tests: add more tests 2014-06-06 00:38:14 -04:00
Douglas Christopher Wilson
db4448dda8 Merge tag '3.9.0' 2014-05-30 22:17:51 -04:00
Douglas Christopher Wilson
8751d7ecf8 tests: add more tests 2014-05-30 21:28:48 -04:00
Douglas Christopher Wilson
c3470c9c96 tests: add route ordering test 2014-05-23 18:46:00 -04:00
Douglas Christopher Wilson
35c50601bd Merge tag '3.6.0' 2014-05-09 17:33:26 -04:00
Douglas Christopher Wilson
a8bb4bab2b tests: add test for app.delete 2014-05-08 16:40:28 -04:00
Jonathan Ong
643397ed21 remove unnecessary test/support/http 2014-03-05 22:06:14 -08:00
Jonathan Ong
0796c1d2d2 test app.router: ignore connect method
so tests pass in 0.11. 0.11 client seems to throw errors more often, so
this is not an issue with express or node’s servers.
2014-02-08 11:39:26 -08: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
Jonathan Ong
3f14b4de1f Merge pull request #1835 from visionmedia/change-req-params-to-object
change req.params to an object instead of an array
2014-01-03 03:00:13 -08:00
Alex Kocharin
7b0dca0f9c throw 400 in case of malformed paths 2013-12-11 17:14:44 -08:00
TJ Holowaychuk
c6c71abf4d change req.params to an object instead of an array 2013-11-27 19:46:39 -08:00
lxe
288176bbc9 Added safe encodeURIcomponent to eliminate errors on malformed captures. 2013-09-16 14:57:31 -04:00
TJ Holowaychuk
91c71d6c2e add app.VERB() paths array deprecation warning 2013-04-15 15:18:28 -07:00
TJ Holowaychuk
a7ca3817db fix route chaining regression. Closes #1397 2012-11-04 12:28:35 -08:00
TJ Holowaychuk
2173d00829 whitespace ocd 2012-07-03 13:57:40 -07:00
riadh
3827f5ef8b tests for issues 1115 fix for utils 2012-07-03 13:56:21 -07:00
TJ Holowaychuk
0f5560eebd updated tests to use "supertest" 2012-06-26 17:14:07 -07:00
TJ Holowaychuk
170dcc2907 Added "methods" dep 2012-06-26 11:38:55 -07:00
TJ Holowaychuk
140efb574c Revert "Added + support to the router"
This reverts commit 6aaa7dc26d.
2012-06-22 08:20:23 -07:00
TJ Holowaychuk
6aaa7dc26d Added + support to the router 2012-06-06 14:38:22 -07:00
TJ Holowaychuk
9fda13bc25 Added url rewriting test 2012-05-10 13:13:03 -07:00
TJ Holowaychuk
e9cd82b72d more * tests 2012-05-02 15:52:26 -07:00
TJ Holowaychuk
4d9ad21047 refactored * routing test 2012-05-02 15:49:38 -07:00
TJ Holowaychuk
082ba88084 tabs -> spaces 2012-04-02 15:41:04 -07:00
TJ Holowaychuk
6d323d3ff7 added param decoding test 2012-04-02 15:15:05 -07:00
Eivind Fjeldstad
38b046d6ad Added test for an array of paths 2012-02-12 16:26:32 +01:00