hyper-fast
Hyper and rust based very fast HTTP Web framework (much faster than actix and other frameworks).
Features
- Supports brotli, deflate and gzip encoding for request and response
- In-built access logs and metrics for APIs
- Simple APIs to get current metrics - in JSON and Prometheus format
- In-built OOR (Out of rotation API) to take server out of rotation
- In-built Server Health API
- Very simple and fast match pattern based routing.
- Much faster than actix and other web servers out there.
- Support for optional daemon service that gets started on server start and stopped on server shutdown
- In-built server shutdown handling.
Example
Look at examples/example_server.rs for a working example. Example can be run with cargo run --example example_server
- Define a service class, implement
Servicetrait for api routing.
- Optional service daemon, could be a dummy implementation - if one doesn't need it.
- Implement
ServiceBuildertrait
- Invoke
start_http_serverin your main method.
async
APIs
/oor- switches the in-rotation status of server/status- gives in-rotation status of server/metrics/json- metrics in JSON format/metrics/prometheus- metrics in Prometheus format/api/<your-api-routes>- all your api routes are after/api