Parse args with clap
This commit is contained in:
parent
a8a58eb103
commit
6a64bd2e47
3 changed files with 126 additions and 0 deletions
|
|
@ -4,10 +4,14 @@ mod r#static;
|
|||
use askama::Template;
|
||||
use askama_axum::{IntoResponse, Response};
|
||||
use axum::{extract::State, http::StatusCode, routing::get, Router};
|
||||
use clap::Parser;
|
||||
use sqlx::SqlitePool;
|
||||
use state::AppState;
|
||||
use tracing_subscriber::filter::LevelFilter;
|
||||
|
||||
#[derive(Debug, clap::Parser)]
|
||||
struct Args {}
|
||||
|
||||
fn set_up_logging() {
|
||||
let filter = tracing_subscriber::filter::Builder::default()
|
||||
.with_default_directive(LevelFilter::INFO.into())
|
||||
|
|
@ -35,6 +39,7 @@ async fn index(State(db): State<SqlitePool>) -> Result<Response, Response> {
|
|||
async fn run() -> anyhow::Result<()> {
|
||||
set_up_logging();
|
||||
|
||||
let args = Args::parse();
|
||||
let state = AppState::new().await?;
|
||||
|
||||
let app = Router::new()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue