feat: V2 with TypeScript

This commit is contained in:
Ben Elferink
2024-12-14 16:14:14 +02:00
parent f6c0a52ab5
commit a41cab872f
63 changed files with 13390 additions and 35925 deletions

View File

@@ -0,0 +1,12 @@
import { type NextFunction, type Request, type Response } from 'express'
const errorHandler = (error: any, req: Request, res: Response, next: NextFunction) => {
const { statusCode = 500, message = 'Internal server error', ...rest } = error
res.status(statusCode).json({
message,
...rest,
})
}
export default errorHandler