feat: initial commit - Moraworld Imports project

This commit is contained in:
Lizandro Guarnizo
2026-06-01 08:06:40 -05:00
commit 094ea9cf81
47 changed files with 12844 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
import { Controller, Get } from "@nestjs/common";
import { PrismaService } from "../prisma/prisma.service";
@Controller()
export class HealthController {
constructor(private readonly prisma: PrismaService) {}
@Get("health")
async health() {
let database: "ok" | "error" = "ok";
try {
await this.prisma.client.$queryRaw`SELECT 1`;
} catch {
database = "error";
}
return {
status: database === "ok" ? "ok" : "degraded",
service: "moraworld-api",
version: "0.1.0",
timestamp: new Date().toISOString(),
checks: {
database,
},
};
}
}
+7
View File
@@ -0,0 +1,7 @@
import { Module } from "@nestjs/common";
import { HealthController } from "./health.controller";
@Module({
controllers: [HealthController],
})
export class HealthModule {}