Skip to content
/ rwf Public

Comprehensive framework for building web applications in Rust.

License

Notifications You must be signed in to change notification settings

levkk/rwf

Repository files navigation

Rwf ‐ Rust Web Framework

Rwf is a comprehensive framework for building web applications in Rust. Written using the classic MVC pattern (model-view-controller), Rwf comes standard with everything you need to easily build fast and secure web apps.

Documentation

📘 The documentation is available here.

Features overview

Quick start

To add Rwf to your stack, create a Rust binary application and add rwf and tokio to your dependencies:

cargo add rwf
cargo add tokio@1 --features full

Building an app is then as simple as:

use rwf::prelude::*;
use rwf::http::Server;

#[derive(Default)]
struct IndexController;

#[async_trait]
impl Controller for IndexController {
    async fn handle(&self, request: &Request) -> Result<Response, Error> {
        Ok(Response::new().html("<h1>Hey Rwf!</h1>"))
    }
}

#[tokio::main]
async fn main() {
    Server::new(vec![
        route!("/" => IndexController),
    ])
    .launch("0.0.0.0:8000")
    .await
    .unwrap();
}

Examples

See examples for common use cases.

🚧 Status 🚧

Rwf is in early development and not ready for production. Many features and documentation are incomplete. Contributions are welcome. Please see CONTRIBUTING for guidelines, ARCHITECTURE for a tour of the code, and ROADMAP for a non-exhaustive list of desired features.