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.
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
}