From b883c002474d359afddee78ffcfc63d9b738e315 Mon Sep 17 00:00:00 2001 From: Oliver Akins Date: Wed, 20 Jul 2022 21:23:38 -0600 Subject: [PATCH] Remove message properties that were causing problems --- server/src/utils/config.ts | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/server/src/utils/config.ts b/server/src/utils/config.ts index 9034134..4250dd8 100644 --- a/server/src/utils/config.ts +++ b/server/src/utils/config.ts @@ -4,32 +4,31 @@ import Joi from "joi"; const schema = Joi.object({ game: Joi.object({ - type: Joi - .string() - .allow( - `file:json`, - // `file:csv`, - // `web:json`, - // `web:csv` - ) - .required() - .message(`Invalid deck type`), - location: Joi - .string() - .required() - .message(`The deck location must be a string`), + code_length: Joi.number().integer().positive(), + fuel_deck: Joi.object({ + type: Joi + .string() + .allow( + `file:json`, + // `file:csv`, + // `web:json`, + // `web:csv` + ) + .required(), + location: Joi + .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`), }), });