mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-16 02:57:24 +08:00
[hapi] Correct the server.table() return type
This commit is contained in:
2
types/hapi/index.d.ts
vendored
2
types/hapi/index.d.ts
vendored
@@ -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[];
|
||||
}
|
||||
|
||||
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user