aboutsummaryrefslogtreecommitdiff
path: root/src/middlewares.ts
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2023-05-31 19:11:57 -0700
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2023-06-03 17:47:44 -0700
commit0f5555b92915b175a685a24ade9276d170ae37f5 (patch)
tree78ae08b1aaa0263d012ca4037028a21728179bd6 /src/middlewares.ts
parent926bebb122ba4226b65088bd0d2f964c8d9e9f8c (diff)
downloadchessh-bot-0f5555b92915b175a685a24ade9276d170ae37f5.tar.gz
chessh-bot-0f5555b92915b175a685a24ade9276d170ae37f5.zip
move to docker compose, fuck vercel
remove other unnecesaary stuff
Diffstat (limited to 'src/middlewares.ts')
-rw-r--r--src/middlewares.ts4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/middlewares.ts b/src/middlewares.ts
index 249ff67..dc98a6c 100644
--- a/src/middlewares.ts
+++ b/src/middlewares.ts
@@ -1,7 +1,5 @@
import { NextFunction, Request, Response } from 'express';
-import ErrorResponse from './interfaces/ErrorResponse';
-
export function notFound(req: Request, res: Response, next: NextFunction) {
res.status(404);
const error = new Error(`🔍 - Not Found - ${req.originalUrl}`);
@@ -9,7 +7,7 @@ export function notFound(req: Request, res: Response, next: NextFunction) {
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
-export function errorHandler(err: Error, req: Request, res: Response<ErrorResponse>, next: NextFunction) {
+export function errorHandler(err: Error, req: Request, res: Response<{message: string, stack?: string | any[]}>, next: NextFunction) {
const statusCode = res.statusCode !== 200 ? res.statusCode : 500;
res.status(statusCode);
res.json({