What problem does it solve?
It solves the need for a consistent, production-grade Express server setup that correctly handles security, middleware ordering, async errors, health checks, shutdown behavior, dependency injection, and testability.
Core Features & Use Cases
- Thin HTTP layer with DI: Keep route files minimal by resolving services from an InversifyJS container rather than instantiating logic directly in handlers.
- Correct middleware ordering: Apply helmet first, configure CORS early, parse JSON with limits, add rate limiting, serve static content safely, expose a no-auth health endpoint, mount API routes, and attach error handling last.
- Reliable async error handling in Express 4: Prevent silent hangs by using an async handler wrapper or
express-async-errors, and ensure the error middleware signature uses four parameters.
- Security hardening: Use helmet plus safe CORS configuration (avoid wildcard origins when using credentials).
- Operational readiness: Add a Kubernetes-friendly health route and implement graceful shutdown, including proper Socket.IO closure.
- Test with Supertest: Validate endpoints without port conflicts by building the app from a test container and running requests directly against the Express instance.
Quick Start
Ask the skill to generate an Express server template that uses a DI container, sets the middleware in the required order, adds robust async error handling, and supports Supertest-based endpoint tests.