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.
$ claude mcp add HTeaPot \
-- python -m otcore.mcp_server <graph>