diff options
Diffstat (limited to 'src/app/api.rs')
| -rw-r--r-- | src/app/api.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/app/api.rs b/src/app/api.rs index 6f88f6c3..c51a1bb0 100644 --- a/src/app/api.rs +++ b/src/app/api.rs @@ -330,7 +330,9 @@ impl App { &mut self, request: crate::api::schema::Request, ) -> String { - use crate::api::schema::{Method, ResponseResult, SuccessResponse}; + use crate::api::schema::{ + ErrorBody, ErrorResponse, Method, ResponseResult, SuccessResponse, + }; let response = match request.method { Method::ServerStop(_) => { @@ -340,6 +342,16 @@ impl App { result: ResponseResult::Ok {}, } } + Method::ServerLiveHandoff(_) => { + let response = ErrorResponse { + id: request.id, + error: ErrorBody { + code: "unsupported_in_app_mode".into(), + message: "live handoff is only supported by the headless server".into(), + }, + }; + return serde_json::to_string(&response).unwrap_or_else(|_| "{}".to_string()); + } Method::ServerReloadConfig(_) => { let report = self.reload_config(); SuccessResponse { |
