module.exports = {
  rateLimitConfig: {
    windowMs: parseInt(process.env.RATE_LIMIT_WINDOW_MS),
    max: parseInt(process.env.RATE_LIMIT_MAX_REQUESTS),
    standardHeaders: true,
    legacyHeaders: false,
    handler: (req, res) => {
      res.status(429).json({
        status: 'error',
        message: 'Too many requests, please try again later.',
        requestId: req.id
      });
    }
  },
  swaggerOptions: {
    definition: {
      openapi: '3.0.0',
      info: {
        title: process.env.API_TITLE,
        version: process.env.API_VERSION,
        description: process.env.API_DESCRIPTION
      },
      servers: [
        {
          url: `http://localhost:${process.env.PORT}`,
          description: 'Development server'
        }
      ],
      components: {
        securitySchemes: {
          bearerAuth: {
            type: 'http',
            scheme: 'bearer',
            bearerFormat: 'JWT'
          }
        }
      }
    },
    apis: ['./src/routes/*.js']
  }
};