Module: services/website-status

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
Name Type Attributes Default Description
isUp boolean

Whether the website or service is up or down

upMessage string <optional>
'up'

The message to display when the website or service is up

downMessage string <optional>
'down'

The message to display when the website or service is down

upColor string <optional>
'brightgreen'

The color to use when the website or service is up

downColor string <optional>
'red'

The color to use when the website or service is down

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' }