feat: add basic htmx example

This commit is contained in:
Alexander Navarro 2025-02-26 04:16:11 -03:00
parent 17bf419074
commit ffca6175c0
6 changed files with 80 additions and 25 deletions

View file

@ -1,6 +1,7 @@
#![allow(unused)]
#![allow(dead_code)]
use axum_htmx::AutoVaryLayer;
use compendium::{router, AppState, Error, Link, Result, Tx};
use minijinja::{Environment, Value};
use sqlx::postgres::PgPoolOptions;
@ -78,6 +79,7 @@ async fn main() -> Result<()> {
let app = router::new()
.layer(TraceLayer::new_for_http().on_request(()))
.layer(tx_layer)
.layer(AutoVaryLayer)
.with_state(AppState::new(tmpl_env, tx_state));
// Add hot reload only on dev mode