{"agent":"claude","input":"Add graceful shutdown to this Express and Mongoose API. Read src/index.js, src/config/config.js, src/config/logger.js, ecosystem.config.json, Dockerfile and docker-compose.yml first. On SIGTERM and SIGINT: stop accepting connections with server.close, wait for in-flight requests, call mongoose.disconnect(), log through the winston logger and exit 0. Add a SHUTDOWN_TIMEOUT_MS setting to the Joi schema in config.js with a default and an .env.example line, and force exit 1 past it with an unref'd timer. Ignore a repeated signal while a shutdown is running. Add a catch to the mongoose.connect promise. Keep exit code 1 for uncaughtException and unhandledRejection but close Mongoose there too. Write an integration test that spawns src/index.js, holds a request open, sends SIGTERM and checks the request completes and the exit code is 0, and one that proves the deadline. Run yarn lint and yarn test against a MongoDB started from docker-compose.yml and quote the results. Open a pull request.","resources":[{"url":"https://github.com/your-org/your-app"}]}