aboutsummaryrefslogtreecommitdiffstats
path: root/crates/pseudonyms/src/lib.rs
blob: 9d76245cf51de765e83de561175ce9fea434414a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
pub mod server;
pub mod state;

use std::sync::Arc;

use serde::Deserialize;
use state::AppHandle;
use tracing::{debug, trace};

#[derive(Deserialize, Clone)]
pub struct AppConfig {
    pub something: Arc<str>,
}

pub async fn run(state: AppHandle, tx: tokio::sync::oneshot::Sender<u16>) -> anyhow::Result<()> {
    trace!("running migrations");
    sqlx::migrate!("./migrations")
        .run(&state.services.postgres)
        .await?;
    debug!("ran migrations");

    server::serve(state, tx).await
}