fix template, remove okr, use casan.*

This commit is contained in:
thanhnv
2026-07-18 16:45:31 +07:00
parent 0dfd1742d3
commit 13fae3e6c3
249 changed files with 4881 additions and 5702 deletions
@@ -0,0 +1,5 @@
import { Module } from '@nestjs/common';
import { HealthController } from './health.controller.js';
@Module({ controllers: [HealthController] })
export class AppModule {}
@@ -0,0 +1,14 @@
import { Controller, Get } from '@nestjs/common';
export interface HealthResponse {
status: 'ok';
service: string;
}
@Controller('health')
export class HealthController {
@Get()
health(): HealthResponse {
return { status: 'ok', service: '__PROJECT_SLUG__-backend' };
}
}
@@ -0,0 +1,15 @@
import 'reflect-metadata';
import { ValidationPipe } from '@nestjs/common';
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module.js';
async function bootstrap(): Promise<void> {
const app = await NestFactory.create(AppModule, { bufferLogs: true });
app.setGlobalPrefix('api/v1', { exclude: ['health'] });
app.useGlobalPipes(new ValidationPipe({ whitelist: true, forbidNonWhitelisted: true, transform: true }));
app.enableCors({ origin: process.env.CORS_ORIGIN?.split(',') ?? ['http://localhost:5173'], credentials: true });
const port = Number(process.env.PORT ?? 3000);
await app.listen(port, '0.0.0.0');
}
void bootstrap();