mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
address comments #2
This commit is contained in:
2
types/hapi/index.d.ts
vendored
2
types/hapi/index.d.ts
vendored
@@ -892,7 +892,7 @@ export interface ServerStartExtConfigurationObject {
|
||||
/**
|
||||
* a function or an array of functions to be executed at a specified point during request processing. The required extension function signature is see ServerExtFunction or see ServerExtRequestHandler
|
||||
*/
|
||||
method: ServerExtFunction
|
||||
method: ServerExtFunction | ServerExtFunction[];
|
||||
options?: ServerExtOptions;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,18 +20,18 @@ var extConfigMulti: Hapi.RouteAdditionalConfigurationOptions = {
|
||||
ext: [{
|
||||
type: 'onPreAuth',
|
||||
method: <Hapi.ServerExtRequestHandler> function (request, reply) {
|
||||
reply('ok');
|
||||
}
|
||||
}, {
|
||||
type: 'onPostAuth',
|
||||
method: <Hapi.ServerExtRequestHandler> function (request, reply) {
|
||||
reply('ok');
|
||||
reply('ok');
|
||||
}
|
||||
}, {
|
||||
type: 'onPostStart',
|
||||
method: <Hapi.ServerExtFunction> function (server, next) {
|
||||
next();
|
||||
}
|
||||
type: 'onPostAuth',
|
||||
method: <Hapi.ServerExtRequestHandler> function (request, reply) {
|
||||
reply('ok');
|
||||
}
|
||||
}, {
|
||||
type: 'onPostStart',
|
||||
method: <Hapi.ServerExtFunction> function (server, next) {
|
||||
next();
|
||||
}
|
||||
}]
|
||||
}
|
||||
|
||||
@@ -39,7 +39,6 @@ var extConfigMulti: Hapi.RouteAdditionalConfigurationOptions = {
|
||||
const user: Hapi.RouteAdditionalConfigurationOptions = {
|
||||
cache: { expiresIn: 5000, statuses: [200, 201] },
|
||||
handler: function (request, reply) {
|
||||
|
||||
return reply({ name: 'John' });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user