afire_compress

Crates.ioafire_compress
lib.rsafire_compress
version0.1.1-alpha
sourcesrc
created_at2022-01-27 20:20:24.072508
updated_at2023-08-21 02:21:49.801623
description🦄 afire middleware to compress outgoing HTTP traffic
homepage
repositoryhttps://github.com/Basicprogrammer10/afire-compress
max_upload_size
id522740
size10,177
Connor Slade (connorslade)

documentation

https://docs.rs/afire_compress

README

afire-compress

🦄 afire middleware to compress outgoing HTTP traffic.

Supports Gzip, Deflate, and Brotli. Make sure this is the first middleware added to a server.

Example

use afire::{Method, Response, Server};
use afire_compress::{Compress, CompressType};

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

    // Add Compressor
    Compress::new().attach(&mut server);

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

    server.start().unwrap();
}
Commit count: 8

cargo fmt