0
0
Fork 0

Initial commit

This commit is contained in:
Oliver 2022-12-23 15:19:37 -06:00 committed by GitHub
commit 56f2195962
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 1121 additions and 0 deletions

30
src/schemas/config.ts Normal file
View file

@ -0,0 +1,30 @@
import Joi from "joi";
export const serverOptionsSchema = Joi.object({
port: Joi
.number()
.port()
.required()
.description(`The port the server will run on`),
})
.meta({ className: `serverOptions` })
.description(`The web server options`);
export const databaseOptionsSchema = Joi.object({
uri: Joi
.string()
.required()
.description(`The location indicator where the database is. This can be a filepath or a socket URI, depending on what database is being used.`),
})
.meta({ className: `databaseOptions` })
.description(`The database specific options`);
export const configSchema = Joi.object({
server: serverOptionsSchema.required(),
database: databaseOptionsSchema.required(),
})
.meta({ className: `config` })
.description(`The configuration format for the server`);