Commonly used functions and utilities for tasks related to website status.
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
Members
+ + + +(inner, constant) exampleQueryParams :object
+ + + + +Example query param object. +Contains up_message, down_message, up_color and down_color properties.
+Type:
+-
+
- + +object + + + +
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
(inner, constant) queryParamSchema :Joi
+ + + + +Joi schema for validating query params. +Checks if the query params obect has valid up_message, down_message, up_color and down_color properties.
+Type:
+-
+
- + +Joi + + + +
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- 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' }
+
+
+
+
+
+
+
+
+
+