first commit
This commit is contained in:
19
apps/api/src/health/health.controller.ts
Normal file
19
apps/api/src/health/health.controller.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { PrismaService } from '../prisma/prisma.service';
|
||||
|
||||
@Controller('health')
|
||||
export class HealthController {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
|
||||
@Get()
|
||||
ok() {
|
||||
return { status: 'ok' };
|
||||
}
|
||||
|
||||
@Get('db')
|
||||
async db() {
|
||||
// Simple connectivity check
|
||||
await this.prisma.$queryRaw`SELECT 1`;
|
||||
return { db: 'connected' };
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user