feat: register admin routes

Made-with: Cursor
This commit is contained in:
Anton
2026-03-04 15:07:22 +03:00
parent 7bea8585c5
commit 5e207ee9b6

View File

@@ -9,6 +9,7 @@ import subscriptionPlugin from './plugins/subscription.js';
import { authRoutes } from './routes/auth.js'; import { authRoutes } from './routes/auth.js';
import { profileRoutes } from './routes/profile.js'; import { profileRoutes } from './routes/profile.js';
import { testsRoutes } from './routes/tests.js'; import { testsRoutes } from './routes/tests.js';
import { adminQuestionsRoutes } from './routes/admin/questions.js';
import { env } from './config/env.js'; import { env } from './config/env.js';
import { randomUUID } from 'node:crypto'; import { randomUUID } from 'node:crypto';
@@ -79,6 +80,7 @@ export async function buildApp(): Promise<FastifyInstance> {
await app.register(authRoutes, { prefix: '/auth' }); await app.register(authRoutes, { prefix: '/auth' });
await app.register(profileRoutes, { prefix: '/profile' }); await app.register(profileRoutes, { prefix: '/profile' });
await app.register(testsRoutes, { prefix: '/tests' }); await app.register(testsRoutes, { prefix: '/tests' });
await app.register(adminQuestionsRoutes, { prefix: '/admin' });
app.get('/health', async () => ({ status: 'ok', timestamp: new Date().toISOString() })); app.get('/health', async () => ({ status: 'ok', timestamp: new Date().toISOString() }));