Flesh out dd0c/alert: webhook routes, incident API, notification config, data layer
- Webhook routes: Datadog, PagerDuty, OpsGenie, Grafana with per-tenant HMAC/token auth - Incident API: list (filtered), detail with alerts, acknowledge/resolve/suppress, dashboard summary - Notification config: CRUD with upsert, test endpoint, Slack/email/webhook channels - Grafana normalizer: severity mapping (critical/warning/info) - Data layer: withTenant() RLS wrapper, Zod config validation - Fastify server entry point with cors/helmet
This commit is contained in:
13
products/03-alert-intelligence/src/config/index.ts
Normal file
13
products/03-alert-intelligence/src/config/index.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
const envSchema = z.object({
|
||||
PORT: z.coerce.number().default(3000),
|
||||
DATABASE_URL: z.string().default('postgresql://localhost:5432/dd0c_alert'),
|
||||
REDIS_URL: z.string().default('redis://localhost:6379'),
|
||||
JWT_SECRET: z.string().min(32).default('dev-secret-change-me-in-production!!'),
|
||||
CORS_ORIGIN: z.string().default('*'),
|
||||
LOG_LEVEL: z.string().default('info'),
|
||||
});
|
||||
|
||||
export const config = envSchema.parse(process.env);
|
||||
export type Config = z.infer<typeof envSchema>;
|
||||
Reference in New Issue
Block a user