feat(backend): add /diagnostics/flags + /diagnostics/telemetry routes
- GET /api/diagnostics/flags — returns all feature flags - GET /api/diagnostics/telemetry — returns buffered telemetry events - POST /api/diagnostics/telemetry/flush — flush telemetry buffer - No auth required (diagnostics endpoints)
This commit is contained in:
parent
f2450b6e2e
commit
d1f2587cc3
@ -15,6 +15,8 @@ import { webhookRoutes } from './modules/webhooks/routes.js';
|
||||
import { initCosmosIfNeeded } from './lib/cosmos-init.js';
|
||||
import { initDatastore } from './lib/datastore.js';
|
||||
import { config } from './lib/config.js';
|
||||
import { getAllFlags } from './lib/feature-flags.js';
|
||||
import { getBufferedEvents, flushEvents } from './lib/telemetry.js';
|
||||
|
||||
import { jwtVerify } from 'jose';
|
||||
import type { JwtPayload } from './lib/request-context.js';
|
||||
@ -50,4 +52,9 @@ await app.register(householdRoutes, { prefix: '/api' });
|
||||
await app.register(sharedTimerRoutes, { prefix: '/api' });
|
||||
await app.register(webhookRoutes, { prefix: '/api' });
|
||||
|
||||
// ── Diagnostics routes (no auth) ────────────────────────────────
|
||||
app.get('/api/diagnostics/flags', async () => getAllFlags());
|
||||
app.get('/api/diagnostics/telemetry', async () => ({ events: getBufferedEvents() }));
|
||||
app.post('/api/diagnostics/telemetry/flush', async () => ({ flushed: flushEvents().length }));
|
||||
|
||||
await startService(app, { port: config.PORT, host: config.HOST });
|
||||
|
||||
Loading…
Reference in New Issue
Block a user