feat(global): initialize project and framework structure, dockerize
This commit is contained in:
11
server/api/health.get.ts
Normal file
11
server/api/health.get.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { defineEventHandler } from 'h3';
|
||||
import prisma from '~~/lib/prisma';
|
||||
|
||||
export default defineEventHandler(async () => {
|
||||
try {
|
||||
await prisma.$queryRaw`SELECT 1`;
|
||||
return { db: 'ok' } as const;
|
||||
} catch {
|
||||
return { db: 'error' } as const;
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user