@lokalise/fastify-extras
Version:
Opinionated set of fastify plugins, commonly used in Lokalise
20 lines (19 loc) • 722 B
TypeScript
import type { FastifyPluginCallback } from 'fastify';
import type { HealthChecker } from './healthcheckCommons.js';
export interface CommonHealthcheckPluginOptions {
responsePayload?: Record<string, unknown>;
logLevel?: 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace' | 'silent';
healthChecks: readonly HealthCheck[];
infoProviders?: readonly InfoProvider[];
isRootRouteEnabled?: boolean;
}
export type InfoProvider = {
name: string;
dataResolver: () => Record<string, unknown>;
};
export type HealthCheck = {
name: string;
isMandatory: boolean;
checker: HealthChecker;
};
export declare const commonHealthcheckPlugin: FastifyPluginCallback<CommonHealthcheckPluginOptions>;