Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/connorslade/afire
🔥 afire — A blazing fast web framework for Rust
https://github.com/connorslade/afire
afire http http-server rust web web-framework webserver
Last synced: about 1 month ago
JSON representation
🔥 afire — A blazing fast web framework for Rust
- Host: GitHub
- URL: https://github.com/connorslade/afire
- Owner: connorslade
- License: mit
- Created: 2021-08-10T01:46:04.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-09T00:43:27.000Z (4 months ago)
- Last Synced: 2024-11-17T04:31:03.194Z (about 2 months ago)
- Topics: afire, http, http-server, rust, web, web-framework, webserver
- Language: Rust
- Homepage: https://crates.io/crates/afire
- Size: 2.49 MB
- Stars: 12
- Watchers: 3
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: Changelog.md
- License: LICENSE
Awesome Lists containing this project
README
afire is a _blazingly fast_ web server micro framework for rust.
## 💠Install
Just add the following to your `Cargo.toml`:
```toml
[dependencies]
afire = "2.2.1"
```## 📄 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.
- [Homepage](https://connorcode.com/writing/afire)
- [Crates.io page](https://crates.io/crates/afire)
- [API Docs](https://docs.rs/afire/latest/afire)## 💥 Example
For more examples see the examples directory [here](https://github.com/Basicprogrammer10/afire/tree/main/examples).
Below is a super simple example so you can see the basics of afire syntax.
```rust no_run
// 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](https://github.com/Basicprogrammer10/afire/blob/main/LICENSE).