Refactor code structure and remove redundant sections for improved readability and maintainability
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
import { Router } from 'express';
|
import { Router } from 'express';
|
||||||
import multer from 'multer';
|
import multer from 'multer';
|
||||||
|
|
||||||
import OrphanagesController from './controllers/OrphanagesController';
|
import OrphanagesController from './src/controllers/OrphanagesController';
|
||||||
import UploadConfig from './config/upload';
|
import UploadConfig from './src/config/upload';
|
||||||
|
|
||||||
const routes = Router();
|
const routes = Router();
|
||||||
const upload = multer(UploadConfig);
|
const upload = multer(UploadConfig);
|
||||||
@@ -4,8 +4,8 @@ import path from 'path';
|
|||||||
import 'express-async-errors';
|
import 'express-async-errors';
|
||||||
import cors from 'cors';
|
import cors from 'cors';
|
||||||
|
|
||||||
import './database/connection'; // This line now automatically runs the connection
|
import './src/database/connection'; // This line now automatically runs the connection
|
||||||
import errorHandler from './errors/handler';
|
import errorHandler from './src/errors/handler';
|
||||||
import routes from './routes';
|
import routes from './routes';
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
Reference in New Issue
Block a user