Crate haro

source ·
Expand description


Haro is a simple and synchronous web framework written in and for Rust.


  • URL Routing with function/closure/trait type
  • Request & Response with minimal boilerplate
    • Query args
    • Post data
    • JSON
    • Cookie
  • Middleware
  • Template (optional)
  • Database (optional)
  • Tests


The “Hello, World!” of Haro is:

use haro::{Application,  Request, Response};

fn main() {
    let mut app = Application::new("0:8000");
    app.route("/", hello);;

fn hello(_: Request) -> Response {
    Response::str("Hello Haro")

Optional Features

Haro uses a set of feature flags to reduce the amount of compiled code and optional dependencies.

You can also use the full feature flag which will enable all public APIs. Beware that this will pull in many extra dependencies that you may not need.

The following optional features are available:

  • database: Enables Database support.
  • template: Enables Template support.


The Haro repo contains a number of examples that show how to put all the pieces together.


Middleware definition and built-in middlewares


A web Application with routes and middlewares
HTTP Request
HTTP Response



redirect is a helper function to generate 301 or 302 Response

Type Definitions

Arc of trait object for route Handler type