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>
This commit is contained in:
1 parent
94eeb1d817
commit
8625d85a87
11 files changed
+145
No files matched your search
@@ -0,0 +1,9 @@
|
||||
import type { FastifyPluginAsync } from 'fastify';
|
||||
|
||||
export const healthRoutes: FastifyPluginAsync = async (fastify) => {
|
||||
fastify.get('/health', async () => ({
|
||||
status: 'ok',
|
||||
uptime: process.uptime(),
|
||||
timestamp: new Date().toISOString(),
|
||||
}));
|
||||
};
|
||||
Reference in new issue
Block a user