saphir 2.0.0-beta

Fully async-await http server framework
Documentation

Saphir is a fully async-await http server framework for rust

The goal is to give low-level control to your web stack (as hyper does) without the time consuming task of doing everything from scratch.

Just use the prelude module, and you're ready to go!

Quick server setup

use saphir::prelude::*;


async fn test_handler(mut req: Request<Body>) -> (u16, Option<String>) {
(200, req.captures_mut().remove("variable"))
}

#[tokio::main]
async fn main() -> Result<(), SaphirError> {
env_logger::init();

let server = Server::builder()
.configure_listener(|l| {
l.interface("127.0.0.1:3000")
})
.configure_router(|r| {
r.route("/{variable}/print", Method::GET, test_handler)
})
.build().await?;

server.run().await
}