https://github.com/rust-dd/tako
https://github.com/rust-dd/tako
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rust-dd/tako
- Owner: rust-dd
- Created: 2025-06-15T21:27:54.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-06-18T22:54:43.000Z (5 months ago)
- Last Synced: 2025-06-18T23:30:13.786Z (5 months ago)
- Language: Rust
- Size: 44.9 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- fucking-awesome-rust - tako - Tako is an asynchronous web framework for Rust on Hyper & Tokio. <b><code> ?⭐</code></b> <b><code> ?🍴</code></b> [GitHub Workflow Status](https://github.com/rust-dd/tako/actions/workflows/ci.yml/badge.svg)) (Libraries / Web programming)
- awesome-rust - tako - Tako is an asynchronous web framework for Rust on Hyper & Tokio. [GitHub Workflow Status](https://github.com/rust-dd/tako/actions/workflows/ci.yml/badge.svg) (Libraries / Web programming)
README
# 🐙 Tako — Lightweight Async Web Framework in Rust
> **Tako** (*"octopus"* in Japanese) is a pragmatic, ergonomic and extensible async web framework for Rust.
> It aims to keep the mental model small while giving you first‑class performance and modern conveniences out‑of‑the‑box.
> **⚠️ Early‑stage software:** Tako is still under active development; use with caution and expect breaking changes.
> [**Blog**: Tako in detail](https://rust-dd.com/post/tako-a-lightweight-async-web-framework-on-tokio-and-hyper)
---
## ✨ Highlights
* **Batteries‑included Router** — Intuitive path‑based routing with path parameters and trailing‑slash redirection (TSR).
* **Extractor system** — Strongly‑typed request extractors for headers, query/body params, JSON, form data, etc.
* **Streaming & SSE** — Built‑in helpers for Server‑Sent Events *and* arbitrary `Stream` responses.
* **Middleware** — Compose synchronous or async middleware functions with minimal boilerplate.
* **Shared State** — Application‑wide state injection without `unsafe` globals.
* **Plugin system** — Opt‑in extensions let you add functionality without cluttering the core API.
* **Hyper‑powered** — Built on `hyper` & `tokio` for minimal overhead and async performance with **native HTTP/2 & TLS** support.
---
## 📦 Installation
Add **Tako** to your `Cargo.toml`:
```toml
[dependencies]
tako-rs = "*"
```
---
## 🚀 Quick Start
Spin up a "Hello, World!" server in a handful of lines:
```rust
use anyhow::Result;
use tako::{
responder::Responder,
router::Router,
types::Request,
Method,
};
use tokio::net::TcpListener;
async fn hello_world(_: Request) -> impl Responder {
"Hello, World!".into_response()
}
#[tokio::main]
async fn main() -> Result<()> {
// Bind a local TCP listener
let listener = TcpListener::bind("127.0.0.1:8080").await?;
// Declare routes
let mut router = Router::new();
router.route(Method::GET, "/", hello_world);
println!("Server running at http://127.0.0.1:8080");
// Launch the server
tako::serve(listener, router).await;
Ok(())
}
```
## 📜 License
`MIT` — see [LICENSE](./LICENSE) for details.
---
Made with ❤️ & 🦀 by the Tako contributors.