Added: Beer API, Docs API and tests for both, fixed build

This commit is contained in:
2024-05-03 01:46:23 +02:00
parent ef4cabff78
commit 44dbf74f1c
10 changed files with 436 additions and 2 deletions

View File

@ -0,0 +1,15 @@
import multer from 'multer';
import {Log} from 'nork'
import { Request, Response, NextFunction } from 'express';
const validateMulterRequestMiddleware = async (err: any, req: Request, res: Response, next: NextFunction) => {
if (err instanceof multer.MulterError) {
Log.error(500, 'error while processing uploaded files', JSON.stringify(err));
res.status(400).json(Log.error(400, 'error while processing uploaded files'));
return;
} else {
next();
}
};
export default validateMulterRequestMiddleware;