@tomisakae/syosetu-api
Version:
Enterprise-grade Fastify TypeScript API for Syosetu.com data extraction using official API and web scraping. Run instantly with 'npx @tomisakae/syosetu-api'
74 lines • 3.14 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.healthRoutes = healthRoutes;
const controllers_1 = require("@/controllers");
async function healthRoutes(fastify) {
fastify.get('/health', {
schema: {
tags: ['Health'],
summary: 'Basic health check',
description: 'Returns basic health status of the API',
response: {
200: {
type: 'object',
properties: {
success: { type: 'boolean' },
data: {
type: 'object',
properties: {
status: { type: 'string' },
message: { type: 'string' },
version: { type: 'string' },
services: {
type: 'array',
items: { type: 'string' }
},
endpoints: { type: 'object' },
features: {
type: 'array',
items: { type: 'string' }
},
timestamp: { type: 'string' }
}
},
timestamp: { type: 'string' }
}
}
}
}
}, controllers_1.healthController.getHealth.bind(controllers_1.healthController));
fastify.get('/api/syosetu/status', {
schema: {
tags: ['Health'],
summary: 'Detailed service status',
description: 'Returns detailed status including cache stats and browser status',
response: {
200: {
type: 'object',
properties: {
success: { type: 'boolean' },
data: {
type: 'object',
properties: {
status: { type: 'string' },
message: { type: 'string' },
version: { type: 'string' },
timestamp: { type: 'string' },
services: { type: 'object' },
cache: { type: 'object' },
browser: { type: 'object' },
features: {
type: 'array',
items: { type: 'string' }
},
endpoints: { type: 'object' }
}
},
timestamp: { type: 'string' }
}
}
}
}
}, controllers_1.healthController.getDetailedStatus.bind(controllers_1.healthController));
}
//# sourceMappingURL=health.routes.js.map