feat: add api http conventions and booking state rules
This commit is contained in:
@@ -23,6 +23,7 @@ import { AdminAuthService } from "./admin-auth.service.js";
|
||||
import { AdminLoginDto } from "./admin-auth.dto.js";
|
||||
import type { FastifyRequest } from "fastify";
|
||||
import { readIdentity, signIdentity } from "./auth.js";
|
||||
import { ApiExceptionFilter, RequestIdMiddleware } from "./http.js";
|
||||
|
||||
@Controller("health")
|
||||
export class HealthController {
|
||||
@@ -250,6 +251,8 @@ export async function createApp(): Promise<NestFastifyApplication> {
|
||||
app.useGlobalPipes(
|
||||
new ValidationPipe({ whitelist: true, forbidNonWhitelisted: true, transform: true }),
|
||||
);
|
||||
app.useGlobalFilters(new ApiExceptionFilter());
|
||||
app.use(new RequestIdMiddleware().use.bind(new RequestIdMiddleware()));
|
||||
app.enableCors();
|
||||
return app;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user