[added] - new routes

This commit is contained in:
Swapnil Bendal
2024-12-18 15:08:10 +05:30
parent ac0d3012c7
commit b8feb4bf89
9 changed files with 64 additions and 27 deletions

View File

@@ -4,9 +4,9 @@ import config from "./config/config";
import morgan from "./config/morgan";
import path from 'path';
import logger from './config/logger';
import ApiError from './utils/helper/ApiError';
import error from './middleware/error';
import routes from './routes';
import ApiError from './utils/helper/ApiError';
class App {
private app: Application;
@@ -38,8 +38,12 @@ class App {
}
private initializeErrorHandling(): void {
this.app.use(error.errorConverter);
this.app.use(error.errorHandler);
this.app.use(error.errorConverter);
this.app.use((req, res, next) => {
console.log('Request passed through middleware.');
next();
});
}
public listen(port: number): ReturnType<typeof this.app.listen> {