afire

Crates.ioafire
lib.rsafire
version3.0.0-alpha.3
sourcesrc
created_at2021-08-21 17:06:59.327636
updated_at2024-02-05 03:03:43.038926
description🔥 A blazing fast web framework for Rust
homepagehttps://connorcode.com/writing/afire
repositoryhttps://github.com/Basicprogrammer10/afire
max_upload_size
id440392
size411,729
Connor Slade (connorslade)

documentation

https://docs.rs/afire

README

🔥 afire Crates.io

THIS IS AN ALPHA RELEASE FOR v3.0.0 – Its probably not the best idea to use this in production and it will definitely have a lot of breaking changes in the future.

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

💠 Install

Just add the following to your Cargo.toml:

[dependencies]
afire = "3.0.0-alpha.3"

📄 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.

use afire::prelude::*;

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

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

  ctx.text(format!("Hello, {}", name))
      .content(Content::TXT)
      .send()?;

  Ok(())
});

server.run().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.

Commit count: 381

cargo fmt