Function
index
(query: web::Query<HashMap<String, String>>)
Source from the content-addressed store, hash-verified
| 15 | struct Index; |
| 16 | |
| 17 | async fn index(query: web::Query<HashMap<String, String>>) -> Result<impl Responder> { |
| 18 | let html = if let Some(name) = query.get("name") { |
| 19 | UserTemplate { |
| 20 | name, |
| 21 | text: "Welcome!", |
| 22 | } |
| 23 | .render() |
| 24 | .expect("template should be valid") |
| 25 | } else { |
| 26 | Index.render().expect("template should be valid") |
| 27 | }; |
| 28 | |
| 29 | Ok(web::Html::new(html)) |
| 30 | } |
| 31 | |
| 32 | #[actix_web::main] |
| 33 | async fn main() -> std::io::Result<()> { |
Callers
nothing calls this directly
Tested by
no test coverage detected