Remove message properties that were causing problems
This commit is contained in:
parent
13711e5986
commit
b883c00247
1 changed files with 18 additions and 20 deletions
|
|
@ -4,32 +4,31 @@ import Joi from "joi";
|
||||||
|
|
||||||
const schema = Joi.object({
|
const schema = Joi.object({
|
||||||
game: Joi.object({
|
game: Joi.object({
|
||||||
type: Joi
|
code_length: Joi.number().integer().positive(),
|
||||||
.string()
|
fuel_deck: Joi.object({
|
||||||
.allow(
|
type: Joi
|
||||||
`file:json`,
|
.string()
|
||||||
// `file:csv`,
|
.allow(
|
||||||
// `web:json`,
|
`file:json`,
|
||||||
// `web:csv`
|
// `file:csv`,
|
||||||
)
|
// `web:json`,
|
||||||
.required()
|
// `web:csv`
|
||||||
.message(`Invalid deck type`),
|
)
|
||||||
location: Joi
|
.required(),
|
||||||
.string()
|
location: Joi
|
||||||
.required()
|
.string()
|
||||||
.message(`The deck location must be a string`),
|
.required(),
|
||||||
|
}),
|
||||||
}),
|
}),
|
||||||
server: Joi.object({
|
server: Joi.object({
|
||||||
port: Joi
|
port: Joi
|
||||||
.number()
|
.number()
|
||||||
.port()
|
.port()
|
||||||
.required()
|
.required(),
|
||||||
.message(`Invalid port number`),
|
|
||||||
cors: Joi.object({
|
cors: Joi.object({
|
||||||
origins: Joi
|
origins: Joi
|
||||||
.array()
|
.array()
|
||||||
.items(Joi.string())
|
.items(Joi.string()),
|
||||||
.message(`The CORS origins must be an array of strings`),
|
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
log: Joi.object({
|
log: Joi.object({
|
||||||
|
|
@ -45,8 +44,7 @@ const schema = Joi.object({
|
||||||
`fatal`
|
`fatal`
|
||||||
)
|
)
|
||||||
.optional()
|
.optional()
|
||||||
.default(`info`)
|
.default(`info`),
|
||||||
.message(`Invalid log level`),
|
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue