| Crates.io | sailfish-web |
| lib.rs | sailfish-web |
| version | 0.2.0 |
| created_at | 2024-06-11 20:33:08.337985+00 |
| updated_at | 2025-02-06 14:03:32.793893+00 |
| description | Simple extension crate that enables a simpler api for web server crates |
| homepage | https://github.com/pauldotsh/sailfish-web |
| repository | https://github.com/pauldotsh/sailfish-web |
| max_upload_size | |
| id | 1268891 |
| size | 72,703 |
Simple extension crate that enables a simpler api for web server crates and other conveniences
#[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.