From 76c89b47fd74e069f9db73503a5131a5a60b8516 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Sat, 10 Aug 2024 21:21:34 +0200 Subject: add 'devices' path to request all available devices --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index b550dd8..edee184 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ use crate::{ config::Config, - routes::{device, start, status}, + routes::{device, devices, start, status}, services::ping::{BroadcastCommand, StatusMap}, storage::Device, }; @@ -36,6 +36,7 @@ mod wol; device::get, device::post, device::put, + devices::get, ), components( schemas( @@ -113,6 +114,7 @@ async fn main() -> color_eyre::eyre::Result<()> { .route("/start/:id", post(start::post).get(start::get)) .route("/device", post(device::post).put(device::put)) .route("/device/:id", get(device::get)) + .route("/devices", get(devices::get)) .route("/status", get(status::status)) .route_layer(from_fn_with_state(shared_state.clone(), auth::auth)) .merge(SwaggerUi::new("/swagger-ui").url("/api-docs/openapi.json", ApiDoc::openapi())) -- cgit v1.2.3