summaryrefslogtreecommitdiff
path: root/src/cli.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli.rs')
-rw-r--r--src/cli.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 191e331..704c004 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -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)?;