Files
lms-be/src/app.service.ts
T
2026-07-07 16:09:12 +09:00

34 lines
615 B
TypeScript

import { Injectable } from '@nestjs/common';
import { PrismaService } from './prisma/prisma.service';
@Injectable()
export class AppService {
constructor(private readonly prisma: PrismaService) {}
getRoot() {
return {
service: 'lms-be',
status: 'ok',
};
}
getHealth() {
return {
status: 'ok',
uptime: process.uptime(),
timestamp: new Date().toISOString(),
};
}
async getDatabaseHealth() {
await this.prisma.$queryRaw`SELECT 1`;
return {
status: 'ok',
provider: 'postgresql',
timestamp: new Date().toISOString(),
};
}
}