@@ -1517,11 +1517,13 @@ Returns a copy of the routing table where:
1517
1517
- ` host ` - optional host to filter routes matching a specific virtual host. Defaults to all virtual
1518
1518
hosts.
1519
1519
1520
- The return value is an object where each key is the ` connection.info.uri ` value of each connection
1521
- and the value is an array of routes where each route contains:
1522
- - ` settings ` - the route config with defaults applied.
1523
- - ` method ` - the HTTP method in lower case.
1524
- - ` path ` - the route path.
1520
+ The return value is an array where each item is an object containing:
1521
+ - ` info ` - the ` connection.info ` the connection the table was generated for.
1522
+ - ` labels ` - the connection labels.
1523
+ - ` table ` - an array of routes where each route contains:
1524
+ - ` settings ` - the route config with defaults applied.
1525
+ - ` method ` - the HTTP method in lower case.
1526
+ - ` path ` - the route path.
1525
1527
1526
1528
Note that if the server has not been started and multiple connections use port ` 0 ` , the table items
1527
1529
will override each other and will produce an incomplete result.
@@ -1533,22 +1535,10 @@ server.connection({ port: 80, host: 'example.com' });
1533
1535
server .route ({ method: ' GET' , path: ' /example' , handler : function (request , reply ) { return reply (); } });
1534
1536
1535
1537
var table = server .table ();
1536
-
1537
- /*
1538
- {
1539
- 'http://example.com:80': [
1540
- {
1541
- method: 'get',
1542
- path: '/example',
1543
- settings: { ... }
1544
- }
1545
- ]
1546
- }
1547
- */
1548
1538
```
1549
1539
1550
1540
When calling ` connection.table() ` directly on each connection, the return value is the same as the
1551
- array value assigned to each connection record :
1541
+ array ` table ` item value of an individual connection:
1552
1542
1553
1543
``` js
1554
1544
var Hapi = require (' hapi' );
0 commit comments