From d51e0bdb54da07653d4d291a8b28badb1386d3c1 Mon Sep 17 00:00:00 2001 From: James Date: Mon, 29 Jan 2018 21:58:11 +1100 Subject: [PATCH] Document REST api --- src/rest.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rest.rs b/src/rest.rs index 529f654..86c79b2 100644 --- a/src/rest.rs +++ b/src/rest.rs @@ -114,6 +114,7 @@ impl Service for WebService { .with_header(ContentType::json()) .with_body(file) } + // Opens a file dialog and returns the path as a string (&Get, "/api/file-select") => { let file_dialog = nfd::open_pick_folder(None).unwrap(); let file = match file_dialog { @@ -130,6 +131,7 @@ impl Service for WebService { .with_header(ContentType::json()) .with_body(file) } + // Returns the default path for a installation (&Get, "/api/default-path") => { let path = self.framework.get_default_path(); @@ -142,6 +144,7 @@ impl Service for WebService { .with_header(ContentType::json()) .with_body(file) } + // Immediately exits the application (&Get, "/api/exit") => { exit(0); }