* Spiget Signed-off-by: Reece Dunham <me@rdil.rocks> * Stack exchange Signed-off-by: Reece Dunham <me@rdil.rocks> * Static-badge Signed-off-by: Reece Dunham <me@rdil.rocks> * Steam Signed-off-by: Reece Dunham <me@rdil.rocks> * Missed one! * Formatting fix Signed-off-by: Reece Dunham <me@rdil.rocks>
25 lines
603 B
JavaScript
25 lines
603 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 category = 'static'
|
|
|
|
static route = {
|
|
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 }
|
|
}
|
|
}
|