Added: tests, signin api, not working docker

This commit is contained in:
2024-05-01 23:24:03 +02:00
parent dc1b955a8a
commit bd8a5d607f
14 changed files with 553 additions and 83 deletions

View File

@ -0,0 +1,15 @@
import { Request, Response, NextFunction } from 'express';
import { object, AnySchema } from 'yup';
import { Log } from 'nork';
const validate = (schema: AnySchema) => async (req: Request, res: Response, next: NextFunction) => {
try {
await schema.validate(req.body);
next();
} catch (err: any) {
return res.status(400).json(Log.error(400, 'validation error', err));
}
};
export default validate;