Decorators
JEC provides a suite of powerful decorators to enhance your endpoints with cross-cutting concerns like logging, timing, authentication, and versioning.
Why Decorators?
Decorators allow you to wrap your route methods with additional functionality without cluttering the business logic. In JEC, decorators are designed to work seamlessly with class-based routes.
@log
Automatic request/response logging for debugging and auditing.
@speed
Performance monitoring and execution time tracking.
@auth
Role-based access control and request authentication.
@version
Semantic versioning enforcement for evolving APIs.
@deprecated
Mark endpoints for deprecation with sunset dates and alternatives.
@ratelimit
Prevent abuse by limiting request frequency.
@timeout
Enforce execution time limits and cancel slow tasks.
@retry
Improve resilience with automatic retries and backoff.