* update joi + joi-extension-semver * @hapi/joi --> joi Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
29 lines
657 B
JavaScript
29 lines
657 B
JavaScript
'use strict'
|
|
|
|
const Joi = require('joi')
|
|
const { BaseStaticService } = require('..')
|
|
|
|
const queryParamSchema = Joi.object({
|
|
message: Joi.string().required(),
|
|
}).required()
|
|
|
|
module.exports = class QueryStringStaticBadge extends BaseStaticService {
|
|
static get category() {
|
|
return 'static'
|
|
}
|
|
|
|
static get route() {
|
|
return {
|
|
base: '',
|
|
pattern: 'static/:schemaVersion(v1)',
|
|
// All but one of the parameters are parsed via coalesceBadge. This
|
|
// reuses what is the override behaviour for other badges.
|
|
queryParamSchema,
|
|
}
|
|
}
|
|
|
|
handle(namedParams, queryParams) {
|
|
return { message: queryParams.message }
|
|
}
|
|
}
|