Remove message properties that were causing problems

This commit is contained in:
Oliver Akins 2022-07-20 21:23:38 -06:00
parent 13711e5986
commit b883c00247
No known key found for this signature in database
GPG key ID: 3C2014AF9457AF99

View file

@ -4,6 +4,8 @@ import Joi from "joi";
const schema = Joi.object({
game: Joi.object({
code_length: Joi.number().integer().positive(),
fuel_deck: Joi.object({
type: Joi
.string()
.allow(
@ -12,24 +14,21 @@ const schema = Joi.object({
// `web:json`,
// `web:csv`
)
.required()
.message(`Invalid deck type`),
.required(),
location: Joi
.string()
.required()
.message(`The deck location must be a string`),
.required(),
}),
}),
server: Joi.object({
port: Joi
.number()
.port()
.required()
.message(`Invalid port number`),
.required(),
cors: Joi.object({
origins: Joi
.array()
.items(Joi.string())
.message(`The CORS origins must be an array of strings`),
.items(Joi.string()),
}),
}),
log: Joi.object({
@ -45,8 +44,7 @@ const schema = Joi.object({
`fatal`
)
.optional()
.default(`info`)
.message(`Invalid log level`),
.default(`info`),
}),
});