Add auth router and service to api index
CI/CD Pipeline / test (push) Successful in 29s
CI/CD Pipeline / deploy-internal (push) Successful in 10s

This commit is contained in:
chris committed 2026-09-30 09:44:48 -04:00
1 parent 3d7be239d6
commit ec5924fda9
1 file changed
+5
+5
View File
@@ -4,6 +4,9 @@ import { CategoryRepository } from './category.repository.ts';
import { createCategoryRouter } from './category.router.ts'; import { createCategoryRouter } from './category.router.ts';
import { join } from 'node:path'; import { join } from 'node:path';
import process from 'node:process'; import process from 'node:process';
import { createAuthRouter } from './auth.router.ts';
import { AuthService } from './auth.service.ts';
try { try {
process.loadEnvFile(join(import.meta.dirname, '../.env')); process.loadEnvFile(join(import.meta.dirname, '../.env'));
@@ -13,6 +16,7 @@ try {
const app = express(); const app = express();
const port = process.env.API_PORT || 8300; const port = process.env.API_PORT || 8300;
const authService = new AuthService();
// Initialize your database pool // Initialize your database pool
const pool = new Pool({ const pool = new Pool({
@@ -20,6 +24,7 @@ const pool = new Pool({
}); });
app.use(express.json()); app.use(express.json());
app.use('/api/auth', createAuthRouter(pool, authService));
// Inject the database pool into the repository layer // Inject the database pool into the repository layer
const categoryRepository = new CategoryRepository(pool); const categoryRepository = new CategoryRepository(pool);