This commit is contained in:
Robin Appelman 2023-11-18 22:04:51 +01:00
commit 684857a9d6
2 changed files with 32 additions and 3 deletions

29
api-server/README.md Normal file
View file

@ -0,0 +1,29 @@
# UGC API at home
Ugc api based on scraping the website
## Endpoints:
### `/player/:id`
Get player by steam id
### `/player/:id/history`
Get team history for player
### `/teams/:format`
Get teams by format (`9v9`, `6v6`, `4v4`, `2v2`)
### `/team/:id`
Get team info by id
### `/team/:id/roster`
Get team roster history
### `/team/:id/matches`
Get team match history

View file

@ -1,7 +1,7 @@
use axum::extract::{Path, State}; use axum::extract::{Path, State};
use axum::http::StatusCode; use axum::http::StatusCode;
use axum::response::{IntoResponse, Response}; use axum::response::{IntoResponse, Response};
use axum::{response::Html, routing::get, Json, Router}; use axum::{routing::get, Json, Router};
use main_error::MainResult; use main_error::MainResult;
use std::env::var; use std::env::var;
use std::net::SocketAddr; use std::net::SocketAddr;
@ -75,8 +75,8 @@ async fn main() -> MainResult {
Ok(()) Ok(())
} }
async fn handler() -> Html<&'static str> { async fn handler() -> &'static str {
Html("<h1>Hello, World!</h1>") include_str!("../README.md")
} }
#[instrument(skip(state))] #[instrument(skip(state))]