Crates.io | sailfish-web |
lib.rs | sailfish-web |
version | 0.1.1 |
source | src |
created_at | 2024-06-11 20:33:08.337985 |
updated_at | 2024-06-17 09:42:10.24668 |
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 | 75,466 |
Simple extension crate that enables a simpler api for web server crates and other conveniences
#[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.