mirror of
https://github.com/yuzu-emu/liftinstall.git
synced 2024-11-22 21:45:37 +01:00
Document REST api
This commit is contained in:
parent
b982383b71
commit
d51e0bdb54
@ -114,6 +114,7 @@ impl Service for WebService {
|
|||||||
.with_header(ContentType::json())
|
.with_header(ContentType::json())
|
||||||
.with_body(file)
|
.with_body(file)
|
||||||
}
|
}
|
||||||
|
// Opens a file dialog and returns the path as a string
|
||||||
(&Get, "/api/file-select") => {
|
(&Get, "/api/file-select") => {
|
||||||
let file_dialog = nfd::open_pick_folder(None).unwrap();
|
let file_dialog = nfd::open_pick_folder(None).unwrap();
|
||||||
let file = match file_dialog {
|
let file = match file_dialog {
|
||||||
@ -130,6 +131,7 @@ impl Service for WebService {
|
|||||||
.with_header(ContentType::json())
|
.with_header(ContentType::json())
|
||||||
.with_body(file)
|
.with_body(file)
|
||||||
}
|
}
|
||||||
|
// Returns the default path for a installation
|
||||||
(&Get, "/api/default-path") => {
|
(&Get, "/api/default-path") => {
|
||||||
let path = self.framework.get_default_path();
|
let path = self.framework.get_default_path();
|
||||||
|
|
||||||
@ -142,6 +144,7 @@ impl Service for WebService {
|
|||||||
.with_header(ContentType::json())
|
.with_header(ContentType::json())
|
||||||
.with_body(file)
|
.with_body(file)
|
||||||
}
|
}
|
||||||
|
// Immediately exits the application
|
||||||
(&Get, "/api/exit") => {
|
(&Get, "/api/exit") => {
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user