Skip to main content
Glama
health.module.ts1.5 kB
import { securityAccess } from '@activepieces/server-shared' import { GetSystemHealthChecksResponse, PrincipalType } from '@activepieces/shared' import { FastifyPluginAsyncTypebox } from '@fastify/type-provider-typebox' import { StatusCodes } from 'http-status-codes' import { healthStatusService } from './health.service' export const healthModule: FastifyPluginAsyncTypebox = async (app) => { await app.register(healthController, { prefix: '/v1/health' }) } const healthController: FastifyPluginAsyncTypebox = async (app) => { app.get( '/', { config: { security: securityAccess.public(), }, }, async (_request, reply) => { const isHealthy = healthStatusService(app.log).isHealthy() if (!isHealthy) { await reply.status(StatusCodes.SERVICE_UNAVAILABLE).send({ status: 'Unhealthy' }) return } await reply.status(StatusCodes.OK).send({ status: 'Healthy' }) }, ), app.get('/system', GetSystemHealthChecks, async (_request, reply) => { await reply.status(StatusCodes.OK).send(await healthStatusService(app.log).getSystemHealthChecks()) }) } const GetSystemHealthChecks = { config: { security: securityAccess.platformAdminOnly([PrincipalType.USER]), }, response: { 200: { description: 'System health checks', type: GetSystemHealthChecksResponse, }, }, }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/activepieces/activepieces'

If you have feedback or need assistance with the MCP directory API, please join our Discord server