-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.rs
More file actions
36 lines (31 loc) · 1.02 KB
/
main.rs
File metadata and controls
36 lines (31 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use queensac::configuration::get_configuration_with_secrets;
use queensac::{Application, KoreanTime};
use shuttle_runtime::SecretStore;
use sqlx::PgPool;
use tracing::{Level, info};
use tracing_subscriber::FmtSubscriber;
#[shuttle_runtime::main]
async fn main(
#[shuttle_shared_db::Postgres] pool: PgPool,
#[shuttle_runtime::Secrets] secrets: SecretStore,
) -> shuttle_axum::ShuttleAxum {
FmtSubscriber::builder()
.with_max_level(Level::INFO)
.with_target(false)
.with_thread_ids(true)
.with_file(true)
.with_line_number(true)
.with_thread_names(true)
.with_level(true)
.with_ansi(true)
.with_timer(KoreanTime)
.pretty()
.init();
info!("Starting queensac service...");
let configuration =
get_configuration_with_secrets(Some(&secrets)).expect("Failed to read configuration.");
let app = Application::build(configuration, pool)
.await
.expect("Failed to build application.");
Ok(app.router.into())
}