mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
[hapi] Added test for request.query
This commit is contained in:
14
types/hapi/test/request/query.ts
Normal file
14
types/hapi/test/request/query.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
// Added test in addition to docs, for request.query
|
||||
|
||||
import * as Hapi from 'hapi';
|
||||
|
||||
interface GetThingQuery {
|
||||
name: string;
|
||||
}
|
||||
|
||||
const handler: Hapi.RouteHandler = function (request, reply) {
|
||||
|
||||
const query = request.query as GetThingQuery;
|
||||
|
||||
return reply(`You asked for ${query.name}`);
|
||||
};
|
||||
Reference in New Issue
Block a user