dorfteich/packages/shared/src/health.ts
Claude Fable 5 b16d23297e Scaffold pnpm monorepo with lint, format, and test tooling
pnpm workspace with apps/web, apps/api, apps/collab, and
packages/shared; strict TypeScript base config, repo-wide ESLint (flat)
+ Prettier, Vitest per package, and root scripts lint/typecheck/test/
build. @dorfteich/shared ships a first health-response helper consumed
by apps/api to prove workspace linking. Existing markdown docs are
reformatted once by the new Prettier setup.

Closes #1

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-04 19:06:27 +02:00

24 lines
536 B
TypeScript

/**
* Shape of the liveness responses served by every Dorfteich service
* (`/healthz` on web, api, and collab). Readiness (`/readyz`) has a richer,
* service-specific shape and lives with the api.
*/
export interface HealthResponse {
status: 'ok';
service: 'web' | 'api' | 'collab';
version: string;
time: string;
}
export function healthResponse(
service: HealthResponse['service'],
version: string,
): HealthResponse {
return {
status: 'ok',
service,
version,
time: new Date().toISOString(),
};
}