afire_compress 0.1.0

🦄 afire middleware to compress outgoing HTTP traffic
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use afire::{Method, Response, Server};
use afire_compress::{Compress, CompressType};

fn main() {
    let mut server = Server::new("localhost", 8080);

    Compress::new()
        .threshold(0)
        .compression(CompressType::Gzip(6))
        .attach(&mut server);

    server.route(Method::GET, "/", |_| Response::new().text("Hello World"));

    server.start().unwrap();
}