Skip to content

Commit

Permalink
feat: update server to return handler result
Browse files Browse the repository at this point in the history
  • Loading branch information
notaphplover committed Jan 30, 2025
1 parent d3659a5 commit b5b12f7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,16 @@ export class InversifyExpressServer {
this._container.get<MiddlewareInstance>(middlewareItem);

if (middlewareInstance instanceof BaseMiddleware) {
return (req: Request, res: Response, next: NextFunction): void => {
return (
req: Request,
res: Response,
next: NextFunction,
): void | Promise<void> => {
const mReq: BaseMiddleware =
this._container.get<BaseMiddleware>(middlewareItem);
mReq.httpContext = this._getHttpContext(req);
mReq.handler(req, res, next);

return mReq.handler(req, res, next);
};
}

Expand Down

0 comments on commit b5b12f7

Please sign in to comment.