diff options
Diffstat (limited to 'src/cli.rs')
| -rw-r--r-- | src/cli.rs | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1,12 +1,12 @@ use std::io; use std::str::FromStr; -use axum::Router; +use axum::{middleware, Router}; use clap::Parser; use sqlx::sqlite::{SqliteConnectOptions, SqlitePool, SqlitePoolOptions}; use tokio::net; -use crate::{error::BoxedError, index, login}; +use crate::{clock, error::BoxedError, index, login}; pub type Result<T> = std::result::Result<T, BoxedError>; @@ -28,7 +28,9 @@ impl Args { sqlx::migrate!().run(&pool).await?; - let app = routers().with_state(pool); + let app = routers() + .route_layer(middleware::from_fn(clock::middleware)) + .with_state(pool); let listener = self.listener().await?; let started_msg = started_msg(&listener)?; |
