| Crates.io | hteapot |
| lib.rs | hteapot |
| version | 0.6.2 |
| created_at | 2024-06-06 18:23:58.669951+00 |
| updated_at | 2025-08-18 18:23:42.242517+00 |
| description | HTeaPot is a lightweight HTTP server library designed to be easy to use and extend. |
| homepage | https://hteapot.albruiz.dev |
| repository | https://github.com/az107/HTeaPot |
| max_upload_size | |
| id | 1263964 |
| size | 114,091 |
A blazing-fast, minimalist HTTP server library built with Rust
A high-performance, lightweight HTTP server and library built in Rust. HTeaPot is designed to deliver exceptional performance for modern web applications while maintaining a simple and intuitive API.
# Install from crates.io
cargo install hteapot
# Or build from source
git clone https://github.com/Az107/hteapot.git
cd hteapot
cargo build --release
config.toml file:[HTEAPOT]
port = 8081 # The port to listen on
host = "localhost" # The host address to bind to
root = "public" # The root directory to serve files from
hteapot ./config.toml
hteapot -s ./public/
Cargo.toml project:cargo add hteapot
exampleuse hteapot::{HttpStatus, HttpResponse, Hteapot, HttpRequest};
fn main() {
// Create a new server instance
let server = Hteapot::new("localhost", 8081);
// Define your request handler
server.listen(move |req: HttpRequest| {
HttpResponse::new(HttpStatus::IAmATeapot, "Hello, I am HTeaPot", None)
});
}
HTeaPot has been benchmarked against other popular HTTP servers, consistently demonstrating excellent metrics:
| Metric | HTeaPot | Industry Average |
|---|---|---|
| Requests/sec | 70,000+ req/s | 30,000 - 50,000 req/s |
| Error rate | < 0.1% | 0.5% - 2% |
| Latency (p99) | 5ms | 15ms - 30ms |
| Memory usage | Low | Moderate |
We welcome contributions from the community! To get started:
# Format the code
cargo fmt
# Lint for warnings
cargo clippy --all-targets --all-features
# Run tests
cargo test
See CONTRIBUTING.md for more details.
HTeaPot is licensed under the MIT License - see the LICENSE file for details.