17 releases (5 stable)

2.1.0 Apr 25, 2023
2.0.0 Feb 11, 2023
1.2.0 Jun 25, 2022
1.0.0 Mar 15, 2022
0.2.0 Nov 4, 2021

#91 in HTTP server

Download history 35/week @ 2023-02-04 178/week @ 2023-02-11 108/week @ 2023-02-18 14/week @ 2023-02-25 44/week @ 2023-03-04 18/week @ 2023-03-11 59/week @ 2023-03-18 14/week @ 2023-03-25 38/week @ 2023-04-01 69/week @ 2023-04-08 19/week @ 2023-04-15 64/week @ 2023-04-22 92/week @ 2023-04-29 124/week @ 2023-05-06 123/week @ 2023-05-13 67/week @ 2023-05-20

406 downloads per month
Used in afire_compress

MIT license

175KB
3K SLoC

🔥 afire Crates.io

afire is a blazingly fast web server micro framework for rust.

💠 Install

Just add the following to your Cargo.toml:

[dependencies]
afire = "2.1.0"

📄 Info

afire is a simple synchronous multithreaded express.js inspired rust web micro framework. wow that was long. It comes with some built extensions in for Static File Serving, Rate limiting, and more.

Below you can find links to some afire related resources.

💥 Example

For more examples see the examples directory here.

Below is a super simple example so you can see the basics of afire syntax.

// Import Lib
use afire::{Server, Method, Response, Header, Content};

// Create Server
let mut server = Server::<()>::new("localhost", 8080);

// Add a route
server.route(Method::GET, "/greet/{name}", |req| {
  let name = req.param("name").unwrap();

  Response::new()
    .text(format!("Hello, {}", name))
    .content(Content::TXT)
});

// Start the server
// This is blocking
server.start().unwrap();

💼 License

afire is licensed under the MIT license so you are free to do basically whatever you want with it as long as you add a copyright notice. You can read the full license text here.

No runtime deps

Features

  • emoji-logging
  • extensions
  • tracing