feat(F-048): completed feature
This commit is contained in:
@@ -1,11 +1,22 @@
|
||||
import type { FastifyInstance } from 'fastify';
|
||||
import type { FastifySchema } from 'fastify';
|
||||
|
||||
interface HealthResponse {
|
||||
status: 'ok';
|
||||
}
|
||||
const healthSchema: FastifySchema = {
|
||||
tags: ['Health'],
|
||||
summary: 'Health check',
|
||||
description: 'Verifica que el servicio está operativo.',
|
||||
response: {
|
||||
200: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
status: { type: 'string', const: 'ok' },
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export async function registerHealthRoutes(app: FastifyInstance): Promise<void> {
|
||||
app.get('/health', async (): Promise<HealthResponse> => {
|
||||
app.get('/health', { schema: healthSchema }, async (): Promise<{ status: 'ok' }> => {
|
||||
return { status: 'ok' };
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user