diff --git a/api/src/index.ts b/api/src/index.ts index 508b44a..49ded4f 100644 --- a/api/src/index.ts +++ b/api/src/index.ts @@ -4,6 +4,9 @@ import { CategoryRepository } from './category.repository.ts'; import { createCategoryRouter } from './category.router.ts'; import { join } from 'node:path'; import process from 'node:process'; +import { createAuthRouter } from './auth.router.ts'; +import { AuthService } from './auth.service.ts'; + try { process.loadEnvFile(join(import.meta.dirname, '../.env')); @@ -13,6 +16,7 @@ try { const app = express(); const port = process.env.API_PORT || 8300; +const authService = new AuthService(); // Initialize your database pool const pool = new Pool({ @@ -20,6 +24,7 @@ const pool = new Pool({ }); app.use(express.json()); +app.use('/api/auth', createAuthRouter(pool, authService)); // Inject the database pool into the repository layer const categoryRepository = new CategoryRepository(pool);