Recipe-app main

This commit is contained in:
2026-04-09 09:14:39 +02:00
commit 962f4e4be5
10015 changed files with 2445177 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
import { Controller, Get } from '@nestjs/common';
import { PrismaService } from '../prisma/prisma.service';
@Controller('health')
export class HealthController {
constructor(private readonly prisma: PrismaService) {}
@Get()
getHealth() {
return {
status: 'ok',
service: 'recipe-api',
timestamp: new Date().toISOString(),
};
}
@Get('db')
async getDatabaseHealth() {
try {
await this.prisma.$queryRaw`SELECT 1`;
return {
status: 'ok',
database: 'connected',
timestamp: new Date().toISOString(),
};
} catch (error) {
return {
status: 'error',
database: 'not reachable',
message: error instanceof Error ? error.message : 'unknown error',
timestamp: new Date().toISOString(),
};
}
}
}
+7
View File
@@ -0,0 +1,7 @@
import { Module } from '@nestjs/common';
import { HealthController } from './health.controller';
@Module({
controllers: [HealthController],
})
export class HealthModule {}