# Deployment और Production — Fastify: High-Performance Node.js APIs बनाना

Source: https://www.skillbyai.com/hi/fastify/ff-deployment

> NODE_ENV, environment secrets, health checks और HTTPS के साथ Fastify को production के लिए तैयार करें।

## Production checklist

`NODE_ENV=production` सेट करें, secrets के लिए environment variables उपयोग करें, health checks जोड़ें, HTTPS enable करें, और reverse proxy उपयोग करें।

## Health check endpoint

Load balancers को आपके app को monitor करने के लिए एक simple health check route।

```javascript
fastify.get('/health', async () => {
  return {
    status: 'ok',
    uptime: process.uptime(),
    timestamp: new Date().toISOString(),
  };
});

fastify.get('/ready', async () => {
  // Check database connectivity, external services, etc.
  try {
    await fastify.db.query('SELECT 1');
    return { ready: true };
  } catch {
    return reply.status(503).send({ ready: false });
  }
});
```
