📄️ CORS Middleware
The CorsMiddleware function in the middlewares package provides Cross-Origin Resource Sharing (CORS) functionality for your Twix router. This middleware allows you to control how your server handles cross-origin requests.
📄️ Logging Middleware
The LoggingMiddleware function in the middlewares package provides logging functionality with colored output for your Twix router. This middleware logs the HTTP method, URL path, status code, and duration of each request.
📄️ Rate Limit Middleware
The RateLimit function in the middlewares package provides rate limiting functionality for your Twix router. This middleware helps control the number of requests a client can make to your server within a specified time window.
📄️ Recovery Middleware
The RecoveryMiddleware function in the middlewares package provides a way to recover from panics in your Twix router. This middleware ensures that if a panic occurs during request handling, it will be logged and a generic 500 Internal Server Error response will be sent to the client.
📄️ JWT Authentication Middleware
The JWTAuth function in the middlewares package provides JSON Web Token (JWT) authentication for your Twix router. This middleware allows you to authenticate requests using JWTs either from the request headers or cookies.