Initial Commit

This commit is contained in:
2026-10-03 20:07:49 +02:00
commit a1346c98b1
427 changed files with 59320 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
import { sql } from 'drizzle-orm'
import { users } from '../db/schema'
export default defineEventHandler(async () => {
try {
const db = useDb()
await db.execute(sql`SELECT 1`)
const [{ count }] = await db
.select({ count: sql<number>`count(*)` })
.from(users)
return { status: 'ok', database: 'connected', users: Number(count) }
}
catch {
throw createError({ statusCode: 503, statusMessage: 'Database unavailable' })
}
})