Files
ketopath/apps/api/src/server.ts
T
lucianoandClaude Opus 4.7 8625d85a87 feat(api): scaffold Fastify server with health route
- ESM Fastify 4 with Pino logger (pretty-print in dev only)
- Plugins: helmet, cors (allowlist via CORS_ORIGINS), rate-limit, sensible
- Zod-validated environment config in src/config/env.ts
- Modular structure under src/modules with /health route
- tsx watch for dev, tsc for build, dist/server.js as production entry

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 12:19:04 +02:00

16 lines
300 B
TypeScript

import { buildApp } from './app.js';
import { env } from './config/env.js';
async function start(): Promise<void> {
const app = await buildApp();
try {
await app.listen({ port: env.PORT, host: env.HOST });
} catch (err) {
app.log.error(err);
process.exit(1);
}
}
void start();