Switch from ajv to io-ts for config validation; validate configs on save in the API/dashboard; start work on creating io-ts schemas for all plugins

This commit is contained in:
Dragory 2019-07-11 12:23:57 +03:00
parent b230a73a6f
commit da114c0e60
14 changed files with 256 additions and 41 deletions

View file

@ -8,7 +8,7 @@ export function error(res: Response, message: string, statusCode: number = 500)
res.status(statusCode).json({ error: message });
}
export function serverError(res: Response, message: string) {
export function serverError(res: Response, message = "Server error") {
error(res, message, 500);
}