File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
src-tauri/src/http/routes Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -8,10 +8,13 @@ mod data;
8
8
mod items;
9
9
mod oauth;
10
10
mod overlay;
11
+ mod server;
11
12
mod sounds;
12
13
13
14
pub fn router ( ) -> Router {
14
15
Router :: new ( )
16
+ // Get server details
17
+ . route ( "/server/details" , get ( server:: details) )
15
18
// OAuth complete page and OAuth complete endpoint
16
19
. route ( "/oauth" , get ( oauth:: handle_oauth) )
17
20
. route ( "/oauth/complete" , post ( oauth:: handle_oauth_complete) )
Original file line number Diff line number Diff line change
1
+ use axum:: Json ;
2
+ use serde:: Serialize ;
3
+
4
+ #[ derive( Serialize ) ]
5
+ pub struct ServerDetails {
6
+ pub identifier : & ' static str ,
7
+ }
8
+
9
+ const IDENTIFIER : & str = "VTFTK_SERVER" ;
10
+
11
+ /// GET /server/details
12
+ ///
13
+ /// Get simple details about the server, used to check if a server
14
+ /// is alive by clients
15
+ pub async fn details ( ) -> Json < ServerDetails > {
16
+ Json ( ServerDetails {
17
+ identifier : IDENTIFIER ,
18
+ } )
19
+ }
You can’t perform that action at this time.
0 commit comments