Refactor static get: website, wercker, wheelmap, wordpress, youtube (#5793)
Co-authored-by: Guillaume <g.alabre@thecodingmachine.com>
This commit is contained in:
@@ -36,37 +36,29 @@ const urlQueryParamSchema = Joi.object({
|
||||
}).required()
|
||||
|
||||
module.exports = class Website extends BaseService {
|
||||
static get category() {
|
||||
return 'monitoring'
|
||||
static category = 'monitoring'
|
||||
|
||||
static route = {
|
||||
base: '',
|
||||
pattern: 'website',
|
||||
queryParamSchema: queryParamSchema.concat(urlQueryParamSchema),
|
||||
}
|
||||
|
||||
static get route() {
|
||||
return {
|
||||
base: '',
|
||||
pattern: 'website',
|
||||
queryParamSchema: queryParamSchema.concat(urlQueryParamSchema),
|
||||
}
|
||||
}
|
||||
|
||||
static get examples() {
|
||||
return [
|
||||
{
|
||||
title: 'Website',
|
||||
namedParams: {},
|
||||
queryParams: {
|
||||
...exampleQueryParams,
|
||||
...{ url: 'https://shields.io' },
|
||||
},
|
||||
staticPreview: renderWebsiteStatus({ isUp: true }),
|
||||
documentation,
|
||||
static examples = [
|
||||
{
|
||||
title: 'Website',
|
||||
namedParams: {},
|
||||
queryParams: {
|
||||
...exampleQueryParams,
|
||||
...{ url: 'https://shields.io' },
|
||||
},
|
||||
]
|
||||
}
|
||||
staticPreview: renderWebsiteStatus({ isUp: true }),
|
||||
documentation,
|
||||
},
|
||||
]
|
||||
|
||||
static get defaultBadgeData() {
|
||||
return {
|
||||
label: 'website',
|
||||
}
|
||||
static defaultBadgeData = {
|
||||
label: 'website',
|
||||
}
|
||||
|
||||
async _request({ url, options = {} }) {
|
||||
|
||||
Reference in New Issue
Block a user