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

sailfish-web

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

2 releases

0.1.1 Jun 17, 2024
0.1.0 Jun 11, 2024

#1096 in HTTP server

33 downloads per month

MIT license

21KB
160 lines

Sailfish-Web

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

Examples

#[derive(TemplateOnce)]
#[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
~481K SLoC