diff --git a/libs/shared-entity/src/dto/server_info_dto.rs b/libs/shared-entity/src/dto/server_info_dto.rs index 04f49d6c..def9d984 100644 --- a/libs/shared-entity/src/dto/server_info_dto.rs +++ b/libs/shared-entity/src/dto/server_info_dto.rs @@ -10,4 +10,5 @@ pub enum SupportedClientFeatures { pub struct ServerInfoResponseItem { pub supported_client_features: Vec, pub minimum_supported_client_version: Option, + pub appflowy_web_url: Option, } diff --git a/src/api/server_info.rs b/src/api/server_info.rs index 39fe076c..a89c2c23 100644 --- a/src/api/server_info.rs +++ b/src/api/server_info.rs @@ -1,17 +1,23 @@ +use actix_web::web::Data; use actix_web::{web, Scope}; use shared_entity::dto::server_info_dto::ServerInfoResponseItem; use shared_entity::response::{AppResponse, JsonAppResponse}; +use crate::state::AppState; + pub fn server_info_scope() -> Scope { web::scope("/api/server").service(web::resource("").route(web::get().to(server_info_handler))) } -async fn server_info_handler() -> actix_web::Result> { +async fn server_info_handler( + state: Data, +) -> actix_web::Result> { Ok( AppResponse::Ok() .with_data(ServerInfoResponseItem { supported_client_features: vec![], minimum_supported_client_version: None, + appflowy_web_url: state.config.appflowy_web_url.clone(), }) .into(), )