feat: embed htmx
This commit is contained in:
parent
35f1433e40
commit
412f4cd2c7
6 changed files with 128 additions and 10 deletions
|
|
@ -30,10 +30,15 @@ impl TryFrom<&Row<'_>> for Plant {
|
|||
}
|
||||
|
||||
pub fn app(ctx: crate::Context) -> axum::Router {
|
||||
Router::new()
|
||||
let mut router = Router::new()
|
||||
.route("/", get(get_index))
|
||||
.route("/plants", post(post_plants))
|
||||
.with_state(ctx)
|
||||
.route("/plants", post(post_plants));
|
||||
|
||||
for (name, content) in crate::STATIC_FILES {
|
||||
router = router.route(&format!("/static/{}", name), get(content))
|
||||
}
|
||||
|
||||
router.with_state(ctx)
|
||||
}
|
||||
|
||||
async fn get_index(State(ctx): State<crate::Context>) -> Html<String> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue