34 releases

0.5.0 Jun 13, 2024
0.5.0-beta.2 Apr 23, 2024
0.5.0-alpha.2 Mar 17, 2024
0.3.14 Oct 1, 2023
0.1.0 Mar 17, 2020

#1 in #fire

Download history 79/week @ 2024-03-19 13/week @ 2024-03-26 64/week @ 2024-04-02 4/week @ 2024-04-09 157/week @ 2024-04-16 213/week @ 2024-04-23 88/week @ 2024-04-30 58/week @ 2024-05-07 27/week @ 2024-05-14 72/week @ 2024-05-21 33/week @ 2024-05-28 4/week @ 2024-06-04 152/week @ 2024-06-11 6/week @ 2024-06-18 11/week @ 2024-07-02

169 downloads per month
Used in 2 crates

MIT/Apache

150KB
4.5K SLoC

A simple http server library.

Example

# use fire_http as fire;
use fire::{get, Res};

struct GlobalName(String);

// handle a simple get request
#[get("/")]
fn root(global_name: Res<GlobalName>) -> String {
	format!("Hi, this is {}", global_name.0)
}

#[tokio::main]
async fn main() {
	let mut server = fire::build("0.0.0.0:3000").await
		.expect("Failed to parse address");

	server.add_data(GlobalName("fire".into()));
	server.add_route(root);

	server.ignite().await.unwrap();
}

For more examples look in the examples directory and the test directory.

Features

  • json
  • fs
  • http2 (enables http 2 support)
  • ws (adds websocket support)
  • trace

Dependencies

~7–20MB
~240K SLoC