diff options
Diffstat (limited to 'src/cli.rs')
| -rw-r--r-- | src/cli.rs | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -10,7 +10,7 @@ use clap::Parser; use sqlx::sqlite::SqlitePool; use tokio::net; -use crate::{app::App, channel, clock, events, login, repo::pool}; +use crate::{app::App, channel, clock, events, expire, login, repo::pool}; /// Command-line entry point for running the `hi` server. /// @@ -70,8 +70,12 @@ impl Args { pub async fn run(self) -> Result<(), Error> { let pool = self.pool().await?; - let app = App::from(pool).await?; + let app = App::from(pool); let app = routers() + .route_layer(middleware::from_fn_with_state( + app.clone(), + expire::middleware, + )) .route_layer(middleware::from_fn(clock::middleware)) .with_state(app); |
