athene 2.0.4

A simple and lightweight rust web framework based on hyper
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use athene::prelude::*;

pub async fn download(_req: Request) -> impl Responder {
    let res = Builder::new();
    res.write_file("Cargo.toml", DispositionType::Attachment)
}

// 127.0.0.1:7878/download
#[tokio::main]
pub async fn main() -> Result<()> {
    let app = athene::new();
    let app = app.router(|r| r.get("/download", download));
    app.listen("127.0.0.1:7878").await
}