The Labbable object is the container used to conveniently obtain a hapi server.
Creates a new Labbable object.
options- an optional object with the following,server- a hapi server. When passed, the labbable instance is immediately made aware ofserver.defaultTimeout- the number of milliseconds to wait (for theserverto be made initialized and/or available) until a timeout error is raised. When set to0orfalseno timeout will be set. Defaults to2000(2 seconds).
server- a hapi server. Makes the labbable instance aware ofserver.
The labbable instance should be made aware of the hapi server as soon as possible. If the labbable instance is already aware of a server, this will throw an error.
options- an optional object with the following,immediate- a boolean that whentruepasses along theserveras soon as it is available tolabbable(typically by callinglabbable.using(server)). By default, labbable will wait until the server is both available and also initialized.timeout- a number in milliseconds, to override thedefaultTimeoutoption specified in the constructor.
cb- a callback with the signaturecb(err, srv),err- an error (such as a timeout).srv- the hapi server instance that has been made initialized and/or available.
When cb is not passed labbable.ready() returns a Promise that resolves with srv as described above, or rejects with err as described above.
Returns true when labbable is aware of a hapi server (typically by calling labbable.using(server)) that has been initialized, and false otherwise.
This is a hapi plugin. It gives the server two server decorations that provide identical functionality to an instance of labbable.
This is identical to labbable.ready(), where the root server is already made available to labbable.
Returns true if server is initialized and false otherwise.