Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 11 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
[package]
edition = "2024"
name = "hteapot"
version = "0.5.0"
exclude = ["config.toml", "demo/", "readme.md"]
license = "MIT"
keywords = ["HTTP", "HTTP-SERVER"]
edition = "2024"
authors = ["Alb Ruiz G. <me@albruiz.dev>"]
description = "HTeaPot is a lightweight HTTP server library designed to be easy to use and extend."
license = "MIT"
readme = "README.md"
documentation = "https://docs.rs/hteapot/"
homepage = "https://github.com/az107/HTeaPot"
repository = "https://github.com/az107/HTeaPot"
readme = "readme.md"
categories = ["network-programming", "web-programming"]
authors = ["Alb Ruiz G. <me@albruiz.dev>"]
keywords = ["http", "server", "web", "lightweight", "rust"]
categories = ["network-programming", "web-programming", "command-line-utilities"]
exclude = ["config.toml", "demo/"]

[lib]
name = "hteapot"
path = "src/hteapot/mod.rs"

[[bin]]
name = "hteapot"

[dependencies]
libc = "0.2"
64 changes: 44 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,19 @@

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.

## Features
## 📚 Table of Contents

- [Features](#--features)
- [Getting Started](#-getting-started)
- [Standalone Server](#standalone-server)
- [As a Library](#as-a-library)
- [Performance](#-performance)
- [Roadmap](#-roadmap)
- [Contributing](#-contributing)
- [License](#-license)
- [Acknowledgments](#-acknowledgments)

## ✨ Features

### Exceptional Performance
- **Threaded Architecture**: Powered by a custom-designed thread system that handles **70,000+ requests per second**
Expand All @@ -34,25 +46,25 @@ A high-performance, lightweight HTTP server and library built in Rust. HTeaPot i
- **Extensible Design**: Easily customize behavior for specific use cases
- **Lightweight Footprint**: Zero dependencies and efficient resource usage

## Getting Started
## 🚀 Getting Started

### Installation
### 🔧 Installation

```bash
# Install from crates.io
cargo install hteapot

# Or build from source
git clone https://github.com/yourusername/hteapot.git
git clone https://github.com/Az107/hteapot.git
cd hteapot
cargo build --release
```

### Standalone Server
### 🖥️ Running the Server

#### Using a configuration file:
#### Option 1: With Config

Create a `config.toml` file:
1. Create a `config.toml` file:

```toml
[HTEAPOT]
Expand All @@ -61,27 +73,27 @@ host = "localhost" # The host address to bind to
root = "public" # The root directory to serve files from
```

Run the server:
2. Run the server:

```bash
hteapot ./config.toml
```

#### Quick serve a directory:
#### Option 2: Quick Serve

```bash
hteapot -s ./public/
```

### As a Library
### 🦀 Using as a Library

1. Add HTeaPot to your project:
1. Add HTeaPot to your ```Cargo.toml``` project:

```bash
cargo add hteapot
```

2. Implement in your code:
2. Implement in your code: ```example```

```rust
use hteapot::{HttpStatus, HttpResponse, Hteapot, HttpRequest};
Expand All @@ -97,16 +109,16 @@ fn main() {
}
```

## Performance
## 📊 Performance

HTeaPot has been benchmarked against other popular HTTP servers, consistently demonstrating excellent metrics:

| Metric | HTeaPot | Industry Average |
|---------------|---------|------------------|
| Requests/sec | 70,000+ | 30,000-50,000 |
| Error rate | <0.1% | 0.5-2% |
| Latency (p99) | 5ms | 15-30ms |
| Memory usage | Low | Moderate |
| 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 |

## Roadmap

Expand All @@ -122,7 +134,19 @@ HTeaPot has been benchmarked against other popular HTTP servers, consistently de

## Contributing

We welcome contributions from the community! See our [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to get involved.
We welcome contributions from the community! To get started:

```sh
# Format the code
cargo fmt

# Lint for warnings
cargo clippy --all-targets --all-features

# Run tests
cargo test
```
See [CONTRIBUTING.md](https://github.com/Az107/HTeaPot/wiki/Contributing) for more details.

## License

Expand Down
Loading