···
import { Elysia } from 'elysia'
2
+
import type { Context } from 'elysia'
import { cors } from '@elysiajs/cors'
3
-
import { openapi, fromTypes } from '@elysiajs/openapi'
import { staticPlugin } from '@elysiajs/static'
import type { Config } from './lib/types'
···
import { logger, logCollector, observabilityMiddleware } from './lib/observability'
import { promptAdminSetup } from './lib/admin-auth'
import { adminRoutes } from './routes/admin'
25
+
import { previewRoutes } from './routes/preview'
domain: (Bun.env.DOMAIN ?? `https://${BASE_HOST}`) as Config['domain'],
···
logger.info('DNS Verifier Started - checking custom domains every 10 minutes')
export const app = new Elysia()
63
-
references: fromTypes()
64
+
development: Bun.env.NODE_ENV !== 'production',
67
+
hmr: Bun.env.NODE_ENV !== 'production'
// Observability middleware
.onBeforeHandle(observabilityMiddleware('main-app').beforeHandle)
67
-
.onAfterHandle((ctx) => {
71
+
.onAfterHandle((ctx: Context) => {
observabilityMiddleware('main-app').afterHandle(ctx)
// Security headers middleware
···
106
+
.use(previewRoutes)
107
-
.get('/client-metadata.json', (c) => {
112
+
.get('/client-metadata.json', () => {
return createClientMetadata(config)
110
-
.get('/jwks.json', async (c) => {
115
+
.get('/jwks.json', async () => {
const keys = await getCurrentKeys()
if (!keys.length) return { keys: [] }