[hapi] Correct the server.table() return type

This commit is contained in:
thomas-b
2018-08-10 15:56:02 +02:00
parent f24106a2ad
commit 8f1ce6502b
2 changed files with 8 additions and 1 deletions

View File

@@ -3790,7 +3790,7 @@ export class Server extends Podium {
* * path - the route path.
* [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servertablehost)
*/
table(host?: string): Array<{settings: ServerRoute; method: Util.HTTP_METHODS_PARTIAL_LOWERCASE, path: string}>; // TODO I am not sure if the ServerRoute is the object expected here
table(host?: string): RequestRoute[];
}
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

View File

@@ -19,4 +19,11 @@ server.route({
server.start();
const table = server.table();
console.log(table);
console.log(table[0].method);
console.log(table[0].path);
console.log(table[0].vhost);
console.log(table[0].realm);
console.log(table[0].settings);
console.log(table[0].fingerprint);
console.log(table[0].auth);
console.log('Server started at: ' + server.info.uri);