#web-server #rocket-web #web-api #web #axum #server-api #rocket

sailfish-web

Simple extension crate that enables a simpler api for web server crates

3 unstable releases

0.2.0 Feb 6, 2025
0.1.1 Jun 17, 2024
0.1.0 Jun 11, 2024

#1267 in HTTP server

Download history 1/week @ 2024-12-04 4/week @ 2024-12-11 130/week @ 2025-02-05

130 downloads per month

MIT license

20KB
160 lines

Sailfish-Web

Simple extension crate that enables a simpler api for web server crates and other conveniences

Examples

#[derive(TemplateSimple)]
#[template(path = "test.stpl")]
struct TestTemplate<'a> {
    s: &'a str,
}

#[get("/hello")]
fn hello() -> RawHtml<String> {
    TemplateWrapper::from(TestTemplate { s: "test" }).into()
}

#[launch]
fn rocket() -> _ {
    rocket::build().mount("/", routes![hello])
}

For more examples you can check the examples.

Dependencies

~0.2–31MB
~463K SLoC