From ec5924fda9f9a787ec3d0edf876e4154e1d2696c Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Wed, 30 Sep 2026 09:44:48 -0400 Subject: [PATCH] Add auth router and service to api index --- api/src/index.ts | 5 +++++ 1 file changed, 5 insertions(+) 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);