Refactor static get: website, wercker, wheelmap, wordpress, youtube (#5793)

Co-authored-by: Guillaume <g.alabre@thecodingmachine.com>
This commit is contained in:
homersimpsons
2020-11-03 20:19:09 +01:00
committed by GitHub
parent 878f4fbcbc
commit 5e335e1bb2
8 changed files with 110 additions and 146 deletions

View File

@@ -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 = {} }) {