Sync LMS backend source
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
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(),
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user