Skip to content

Commit

Permalink
Remove non necessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
leung018 committed Feb 7, 2024
1 parent 00be6b4 commit ad307ae
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions backend/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import express, {
Express,
NextFunction,
Request,
Response,
Router,
} from 'express'
import express, { Express, NextFunction, Request, Response } from 'express'
import { DutiesRouteService } from './route/duties'
import morgan from 'morgan'
import { ApplicationContext } from './context'
Expand Down Expand Up @@ -51,17 +45,7 @@ export class ExpressAppInitializer {
}

addRouteService(path: string, routeService: RouteService) {
this.app.use(path, this.routerHandler(routeService.router))
}

private routerHandler(router: Router) {
return async (req: Request, res: Response, next: NextFunction) => {
try {
await router(req, res, next)
} catch (error) {
next(error)
}
}
this.app.use(path, routeService.router)
}
}

Expand Down

0 comments on commit ad307ae

Please sign in to comment.