Constructor
new Index(config, methodopt, pathopt, descriptionopt)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
config |
Config | |||
method |
string |
<optional> |
'GET' | |
path |
string |
<optional> |
'/' | |
description |
string |
<optional> |
'Index route' |
- Source:
Extends
Methods
buildOperation(request, reply) → {Promise.<FlamingoOperation>}
Function to build the flamingo operation based on the incoming request + reply function.
Each extending class should call super.buildOperation to get a minimal working flamingo operation.
Parameters:
Name | Type | Description |
---|---|---|
request |
Request | |
reply |
function |
- Inherited From:
- Source:
- See:
Returns:
- Type
- Promise.<FlamingoOperation>
handle(operation)
Function that is called for each request.
To send the response, call `operation.reply()`.
Parameters:
Name | Type | Description |
---|---|---|
operation |
FlamingoOperation |
- Overrides:
- Source:
- See:
handleError(request, reply, error, operationopt) → {*}
Function to log and reply errors
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
request |
Request | ||
reply |
function | function that replies to the request | |
error |
Error | ||
operation |
FlamingoOperation |
<optional> |
- Inherited From:
- Source:
Returns:
reply return value
- Type
- *
hapiConfig(defaults)
Function to build the hapi route config object
Parameters:
Name | Type | Description |
---|---|---|
defaults |
Object |
- Inherited From:
- Source:
- See: