tinyhttp 0.6.0

A HTTP library with SSL and GZIP support
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use tinyhttp::prelude::*;

use tokio::net::TcpListener;

#[get("/")]
fn get() -> &'static str {
    "Hello World!\n"
}

#[tokio::main]
async fn main() {
    let socket = TcpListener::bind(":::9001").await.unwrap();
    let config = Config::new().routes(Routes::new(vec![get()]));
    HttpListener::new(socket, config).start().await;
}