MCPcopy Create free account
hub / github.com/Botloader/botloader / run_http_server

Function run_http_server

cmd/dbserver/src/main.rs:36–55  ·  view source on GitHub ↗
(conf: crate::BrokerConfig, postgres: Db)

Source from the content-addressed store, hash-verified

34}
35
36pub async fn run_http_server(conf: crate::BrokerConfig, postgres: Db) {
37 let app = Router::new()
38 .route(
39 "/create_update_premium_slots_by_source",
40 get(handle_post_premium_slots_by_source),
41 )
42 // .layer(Extension(discord_state))
43 .layer(Extension(postgres))
44 .layer(axum_metrics_layer::MetricsLayer {
45 name_prefix: "bl.db",
46 });
47
48 // run it with hyper on configured address
49 info!("Starting hype on address: {}", conf.http_api_listen_addr);
50
51 let listener = tokio::net::TcpListener::bind(conf.http_api_listen_addr)
52 .await
53 .unwrap();
54 axum::serve(listener, app).await.unwrap();
55}
56
57async fn handle_post_premium_slots_by_source(
58 Extension(store): Extension<Db>,

Callers 1

mainFunction · 0.70

Calls 2

getFunction · 0.50
layerMethod · 0.45

Tested by

no test coverage detected