summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs
index aab9df3..9d30548 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -11,10 +11,10 @@ use tracing::{info, level_filters::LevelFilter};
11use tracing_subscriber::{EnvFilter, fmt::{self, time::LocalTime}, prelude::*}; 11use tracing_subscriber::{EnvFilter, fmt::{self, time::LocalTime}, prelude::*};
12use crate::config::SETTINGS; 12use crate::config::SETTINGS;
13use crate::db::init_db_pool; 13use crate::db::init_db_pool;
14use crate::routes::device::{get_device, post_device, put_device}; 14use crate::routes::device;
15use crate::routes::start::start; 15use crate::routes::start::start;
16use crate::routes::status::status; 16use crate::routes::status::status;
17use crate::services::ping::{BroadcastCommands, PingMap}; 17use crate::services::ping::{BroadcastCommands, StatusMap};
18 18
19mod auth; 19mod auth;
20mod config; 20mod config;
@@ -54,15 +54,15 @@ async fn main() -> color_eyre::eyre::Result<()> {
54 54
55 let (tx, _) = channel(32); 55 let (tx, _) = channel(32);
56 56
57 let ping_map: PingMap = DashMap::new(); 57 let ping_map: StatusMap = DashMap::new();
58 58
59 let shared_state = Arc::new(AppState { db, ping_send: tx, ping_map }); 59 let shared_state = Arc::new(AppState { db, ping_send: tx, ping_map });
60 60
61 let app = Router::new() 61 let app = Router::new()
62 .route("/start", post(start)) 62 .route("/start", post(start))
63 .route("/device", get(get_device)) 63 .route("/device", get(device::get))
64 .route("/device", put(put_device)) 64 .route("/device", put(device::put))
65 .route("/device", post(post_device)) 65 .route("/device", post(device::post))
66 .route("/status", get(status)) 66 .route("/status", get(status))
67 .with_state(shared_state); 67 .with_state(shared_state);
68 68
@@ -78,5 +78,5 @@ async fn main() -> color_eyre::eyre::Result<()> {
78pub struct AppState { 78pub struct AppState {
79 db: PgPool, 79 db: PgPool,
80 ping_send: Sender<BroadcastCommands>, 80 ping_send: Sender<BroadcastCommands>,
81 ping_map: PingMap, 81 ping_map: StatusMap,
82} 82}