Overview
The Horse framework provides a collection of officially maintained middleware packages to extend functionality. These middlewares are maintained by the Horse core team and provide essential features for web applications.Available Middlewares
horse/json (Jhonson)
JSON serialization and deserialization middleware.- Repository: github.com/HashLoad/jhonson
- Delphi: ✔️ Supported
- Lazarus: ✔️ Supported
- Automatic JSON parsing for request bodies
- Automatic JSON serialization for response objects
- Support for custom serialization rules
horse/basic-auth
HTTP Basic Authentication middleware.- Repository: github.com/HashLoad/horse-basic-auth
- Delphi: ✔️ Supported
- Lazarus: ✔️ Supported
- Simple username/password authentication
- Custom validation callback support
- Configurable realm
horse/cors
Cross-Origin Resource Sharing (CORS) middleware.- Repository: github.com/HashLoad/horse-cors
- Delphi: ✔️ Supported
- Lazarus: ✔️ Supported
- Configure allowed origins
- Configure allowed methods
- Configure allowed headers
- Support for credentials
horse/stream
Octet stream middleware for binary data handling.- Repository: github.com/HashLoad/horse-octet-stream
- Delphi: ✔️ Supported
- Lazarus: ✔️ Supported
- Handle binary request data
- Send binary response data
- Stream processing support
horse/jwt
JSON Web Token (JWT) authentication middleware.- Repository: github.com/HashLoad/horse-jwt
- Delphi: ✔️ Supported
- Lazarus: ✔️ Supported
- JWT token validation
- Token generation helpers
- Configurable secret key
- Custom claims support
horse/exception
Exception handling middleware.- Repository: github.com/HashLoad/handle-exception
- Delphi: ✔️ Supported
- Lazarus: ✔️ Supported
- Global exception handling
- Custom error responses
- Exception logging
- Development/production modes
horse/logger
Request/response logging middleware.- Repository: github.com/HashLoad/horse-logger
- Delphi: ✔️ Supported
- Lazarus: ✔️ Supported
- Request logging
- Response logging
- Configurable log formats
- File and console output
horse/compression
Response compression middleware (gzip, deflate).- Repository: github.com/HashLoad/horse-compression
- Delphi: ✔️ Supported
- Lazarus: ✔️ Supported
- Gzip compression
- Deflate compression
- Configurable compression threshold
- Content-type filtering
Compatibility Matrix
| Middleware | Delphi | Lazarus |
|---|---|---|
| horse/json | ✔️ | ✔️ |
| horse/basic-auth | ✔️ | ✔️ |
| horse/cors | ✔️ | ✔️ |
| horse/stream | ✔️ | ✔️ |
| horse/jwt | ✔️ | ✔️ |
| horse/exception | ✔️ | ✔️ |
| horse/logger | ✔️ | ✔️ |
| horse/compression | ✔️ | ✔️ |
See Also
- Third-Party Middlewares - Community-created middlewares
- THorse - Main framework API
- Callbacks - Middleware callback types
