#web-framework #customizable #rusty

rusty-web

Rusty Web is a lightweight web framework for rust developers

2 releases

0.0.2 Mar 20, 2024
0.0.1 Feb 20, 2024

#281 in HTTP server

Download history 135/week @ 2024-02-20 20/week @ 2024-02-27 19/week @ 2024-03-05 1/week @ 2024-03-12 163/week @ 2024-03-19 2/week @ 2024-03-26 24/week @ 2024-04-02

95 downloads per month

MIT license

100KB
2K SLoC

Rusty Web

Rusty Web

Rusty web is a simple to use, fully customizable lightweight web framework for rust developers. Learn rusty web

Installation

[dependencies]
rusty-web = "0.0.1"

Sample

use rusty_web::paths::{Path, Paths};
use rusty_web::request::Request;
use rusty_web::response::Response;
use rusty_web::server::run_server;
use rusty_web::status::Status;

fn home(request: Request, mut response: Response) {
    response.html(Status::Ok, "Home Page".to_string()).send();
}

fn about(request: Request, mut response: Response) {
    response.html(Status::Ok, "About Us".to_string()).send();
}

fn main() {
    let paths: Paths = vec![
        Path::new("/", home),
        Path::new("/about/", about),
    ];

    run_server("0.0.0.0:8080", paths);
}

Conclusion

This framework don't force you to follow particular format. You can stream response however you like.

Dependencies

~4–13MB
~161K SLoC