mudroom 0.1.2

A TUI client and server for multiplayer text adventure games.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::network::event::ServerInfoResponse;

pub async fn get_server_info(url: &str) -> Result<ServerInfoResponse, Box<dyn std::error::Error>> {
    let client = reqwest::Client::new();
    let resp = client
        .get(format!("{url}/server/info"))
        .send()
        .await?
        .json::<ServerInfoResponse>()
        .await?;
    Ok(resp)
}