Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 540 Bytes

README.md

File metadata and controls

24 lines (19 loc) · 540 Bytes

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.