Members

(static) waibu:onClose :external:THook

Hook object for the 'waibu:onClose' event. The handler is invoked when the server is closed and logs a message indicating that the server has been closed.

Properties
NameTypeAttributesDefaultDescription
namestring<optional>
'waibu:onClose'

The name of the hook

handleronCloseHandler

The handler function for the hook

(static) waibu:onReady :external:THook

Hook object for the 'waibu:onReady' event. The handler is invoked when the server is ready and logs a message indicating that the server is ready.

Properties
NameTypeAttributesDefaultDescription
namestring<optional>
'waibu:onReady'

The name of the hook

handleronReadyHandler

The handler function for the hook

(static) waibu:onRequest :external:THook

Hook object for the 'waibu:onRequest' event. The handler is invoked when a request is received and logs the request details, including the method, URL, and IP address.

Properties
NameTypeAttributesDefaultDescription
levelnumber<optional>
5

The level of the hook

namestring<optional>
'waibu:onRequest'

The name of the hook

handleronRequestHandler

The handler function for the hook

(static) waibu:onResponse :external:THook

Hook object for the 'waibu:onResponse' event. The handler is invoked when a response is sent and logs the response details, including the method, URL, status code, and elapsed time.

Properties
NameTypeAttributesDefaultDescription
levelnumber<optional>
5

The level of the hook

namestring<optional>
'waibu:onResponse'

The name of the hook

handleronResponseHandler

The handler function for the hook

(static) waibu:onRoute :external:THook

Hook object for the 'waibu:onRoute' event. The handler is invoked when a new route is registered and adds the route options to the list of routes.

Properties
NameTypeAttributesDefaultDescription
levelnumber<optional>
5

The level of the hook

namestring<optional>
'waibu:onRoute'

The name of the hook

handleronRouteHandler

The handler function for the hook

(static) waibu:preParsing :external:THook

Hook object for the 'waibu:preParsing' event. The handler is invoked before parsing the request and attaches internationalization (i18n) support to the request and reply objects.

Properties
NameTypeAttributesDefaultDescription
levelnumber<optional>
9

The level of the hook

namestring<optional>
'waibu:preParsing'

The name of the hook

handleronPreParsingHandler

The handler function for the hook

Type Definitions

(async) onCloseHandler()

(async) onReadyHandler()

(async) onRequestHandler(req, reply)

Parameters:
NameTypeDescription
reqobject

The request object

replyobject

The reply object

(async) onResponseHandler(req, reply)

Parameters:
NameTypeDescription
reqobject

The request object

replyobject

The reply object

(async) onRouteHandler(options)

Parameters:
NameTypeDescription
optionsobject

The route options object

(async) waibuPreParsingHandler(req, reply)

Parameters:
NameTypeDescription
reqobject

The request object

replyobject

The reply object