diff options
author | fxqnlr <[email protected]> | 2024-08-10 21:21:34 +0200 |
---|---|---|
committer | fxqnlr <[email protected]> | 2024-08-10 21:21:34 +0200 |
commit | 76c89b47fd74e069f9db73503a5131a5a60b8516 (patch) | |
tree | 5c6beb74abe986554b9b56cac4673b8e0c743e92 /src/main.rs | |
parent | 3e8866c07fbd6c2819ff3833e52ede9158a9862d (diff) | |
download | webol-76c89b47fd74e069f9db73503a5131a5a60b8516.tar webol-76c89b47fd74e069f9db73503a5131a5a60b8516.tar.gz webol-76c89b47fd74e069f9db73503a5131a5a60b8516.zip |
add 'devices' path to request all available devices
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 4 |
1 files changed, 3 insertions, 1 deletions
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 @@ | |||
1 | use crate::{ | 1 | use crate::{ |
2 | config::Config, | 2 | config::Config, |
3 | routes::{device, start, status}, | 3 | routes::{device, devices, start, status}, |
4 | services::ping::{BroadcastCommand, StatusMap}, | 4 | services::ping::{BroadcastCommand, StatusMap}, |
5 | storage::Device, | 5 | storage::Device, |
6 | }; | 6 | }; |
@@ -36,6 +36,7 @@ mod wol; | |||
36 | device::get, | 36 | device::get, |
37 | device::post, | 37 | device::post, |
38 | device::put, | 38 | device::put, |
39 | devices::get, | ||
39 | ), | 40 | ), |
40 | components( | 41 | components( |
41 | schemas( | 42 | schemas( |
@@ -113,6 +114,7 @@ async fn main() -> color_eyre::eyre::Result<()> { | |||
113 | .route("/start/:id", post(start::post).get(start::get)) | 114 | .route("/start/:id", post(start::post).get(start::get)) |
114 | .route("/device", post(device::post).put(device::put)) | 115 | .route("/device", post(device::post).put(device::put)) |
115 | .route("/device/:id", get(device::get)) | 116 | .route("/device/:id", get(device::get)) |
117 | .route("/devices", get(devices::get)) | ||
116 | .route("/status", get(status::status)) | 118 | .route("/status", get(status::status)) |
117 | .route_layer(from_fn_with_state(shared_state.clone(), auth::auth)) | 119 | .route_layer(from_fn_with_state(shared_state.clone(), auth::auth)) |
118 | .merge(SwaggerUi::new("/swagger-ui").url("/api-docs/openapi.json", ApiDoc::openapi())) | 120 | .merge(SwaggerUi::new("/swagger-ui").url("/api-docs/openapi.json", ApiDoc::openapi())) |