Features Code
Get Started

Rust Web Framework

Small. Sweet.
Blazingly Fast.

Build fast web applications with minimal code. Hotaru combines Rust's performance with an API that just feels right. Actively stabilizing toward 1.0.

main.rs
use hotaru::prelude::*;
use hotaru::http::*;

LServer!(APP = Server::new()
    .binding("127.0.0.1:3000")
    .build());

endpoint! {
    APP.url("/"),
    pub hello<HTTP> {
        text_response("Hello, Hotaru!")
    }
}

Why Hotaru

Everything you need.
Nothing you don't.

Zero Magic

What you write is what you get. No hidden complexity, no surprising behaviors. Just clean, explicit Rust code.

Multi-Protocol

HTTP, WebSocket, and custom TCP protocols. One framework, infinite possibilities.

Full-Stack Ready

Built-in Akari template engine for server-rendered HTML.

Secure by Default

Request validation, body limits, and method whitelisting.

Powerful Middleware

Async middleware with protocol-aware inheritance.

Regex Routing

Flexible pattern matching with typed parameters.

Developer Experience

Write less.
Ship more.

Hello World
use hotaru::prelude::*;
use hotaru::http::*;

LServer!(APP = Server::new()
    .binding("127.0.0.1:3000")
    .build());

endpoint! {
    APP.url("/"),
    pub index<HTTP> {
        text_response("Hello, World!")
    }
}

#[tokio::main]
async fn main() {
    APP.clone().run().await;
}
Path Parameters
endpoint! {
    APP.url("/users/<int:id>"),
    pub get_user<HTTP> {
        let user_id = req.pattern("id")
            .unwrap_or("unknown".to_string());

        akari_json!({
            id: user_id,
            name: "Alice",
            email: "alice@example.com"
        })
    }
}

// GET /users/42 → {"id":"42","name":"Alice",...}
Akari Templates
endpoint! {
    APP.url("/profile"),
    pub profile<HTTP> {
        akari_render!(
            "profile.html",
            name = "Alice",
            email = "alice@example.com",
            posts = ["First post", "Second post"]
        )
    }
}

// Server-rendered HTML with type-safe templates
Async Middleware
middleware! {
    pub Logger<HTTP> {
        let start = std::time::Instant::now();
        let path = req.path().to_string();

        let req = next(req).await?;

        println!("[LOG] {} - {:?}",
            path, start.elapsed());

        Ok(req)
    }
}

LServer!(APP = Server::new()
    .binding("127.0.0.1:3003")
    .single_protocol(
        ProtocolBuilder::new(HTTP::server(HttpSafety::default()))
            .append_middleware::<GlobalLogger>()
            .append_middleware::<GlobalMetrics>()
    )
    .build());

Ready to build
something beautiful?

Get started with Hotaru in seconds. One command is all it takes.

cargo add hotaru