address comments #2

This commit is contained in:
Simon Schick
2017-05-17 01:22:34 +02:00
parent ac46bea13a
commit f2cf1da49c
2 changed files with 11 additions and 12 deletions

View File

@@ -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;
}

View File

@@ -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' });
}
};