@damourlabs/euro-clinical-trials
Version:
A Nuxt 3 application for visualizing and managing clinical trials data in Europe, built with modern web technologies.
26 lines (22 loc) • 566 B
text/typescript
export default defineEventHandler(async () => {
try {
// Get database instance
const db = appDatabase()
console.log('Checking database health.. from module')
// Simple health check query
await db.exec('SELECT 1')
return {
status: 'ready',
timestamp: new Date().toISOString(),
database: 'pglite'
}
} catch (error) {
throw createError({
statusCode: 503,
statusMessage: 'Database not ready',
data: {
error: error instanceof Error ? error.message : 'Unknown error'
}
})
}
})