Commonly used functions and utilities for tasks related to website status.
- Source:
Members
(inner, constant) queryParamSchema :Joi
Joi schema for validating query params. Checks if the query params object has valid up_message, down_message, up_color and down_color properties.
Type:
- Joi
- Source:
(inner, constant) queryParams :Array.<module:core/base-service/openapi~OpenApiParam>
Array of OpenAPI Parameter Objects describing the up_message, down_message, up_color and down_color query params
Type:
- Source:
Methods
(inner) renderWebsiteStatus(options) → {object}
Creates a badge object that displays information about website status.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object | The options for rendering the status Properties
|
- Source:
Returns:
An object with a message and a color property
- Type
- object
Example
renderWebsiteStatus({ isUp: true }) // returns { message: 'up', color: 'brightgreen' }
renderWebsiteStatus({ isUp: false }) // returns { message: 'down', color: 'red' }