treemux 0.8.5

A high performance HTTP request router that scales well.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use hyper::Server;
use treemux::{static_files, RouterBuilder, Treemux};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
  let mut router = Treemux::builder();
  router.get("/", static_files("./examples/static"));
  router.get("/*", static_files("./examples/static"));

  Server::bind(&([127, 0, 0, 1], 3000).into())
    .serve(router.into_service())
    .await?;
  Ok(())
}