| 1 | use sqlx::SqlitePool; |
| 2 | use topcoat::{ |
| 3 | Result, |
| 4 | context::{Cx, app_context}, |
| 5 | router::page, |
| 6 | view::view, |
| 7 | }; |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | #[page("/")] |
| 15 | async fn home(cx: &Cx) -> Result { |
| 16 | let pool: &SqlitePool = app_context(cx); |
| 17 | let sqlite_version: String = sqlx::query_scalar("select sqlite_version()") |
| 18 | .fetch_one(pool) |
| 19 | .await?; |
| 20 | |
| 21 | view! { |
| 22 | <!DOCTYPE html> |
| 23 | <html> |
| 24 | <head> |
| 25 | <title>"steid"</title> |
| 26 | topcoat::dev::script() |
| 27 | </head> |
| 28 | <body> |
| 29 | <h1>"steid"</h1> |
| 30 | <p>"sqlite " (sqlite_version)</p> |
| 31 | </body> |
| 32 | </html> |
| 33 | } |
| 34 | } |