From a91a2ca5c88403e905bf0f798393587fc4d900fa Mon Sep 17 00:00:00 2001 From: FxQnLr Date: Mon, 8 Apr 2024 15:44:31 +0200 Subject: Closes #26. Addtional GET request for /start --- src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 43957ff..a8acc5f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,7 +37,8 @@ mod wol; #[derive(OpenApi)] #[openapi( paths( - start::start, + start::post, + start::get, start::start_payload, device::get, device::get_payload, @@ -119,13 +120,14 @@ async fn main() -> color_eyre::eyre::Result<()> { let app = Router::new() .route("/start", post(start::start_payload)) - .route("/start/:id", post(start::start)) + .route("/start/:id", post(start::post).get(start::get)) .route( "/device", post(device::post).get(device::get_payload).put(device::put), ) .route("/device/:id", get(device::get)) .route("/status", get(status::status)) + // TODO: Don't load on `None` Auth .route_layer(from_fn_with_state(shared_state.clone(), auth::auth)) .merge(SwaggerUi::new("/swagger-ui").url("/api-docs/openapi.json", ApiDoc::openapi())) .with_state(Arc::new(shared_state)); -- cgit v1.2.3