-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Multi platform build w/ QEMU - Bump Rust version to use sparse registry - /mc/matches route - Configurable ports - Make sure punishment is actually active - Fix join sound route
- Loading branch information
Showing
9 changed files
with
57 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM rust:1.67 | ||
FROM rust:1.72 | ||
WORKDIR /usr/src/mars-api | ||
RUN mkdir /app | ||
COPY . . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use rocket::{State, Build, Rocket}; | ||
use crate::{database::models::r#match::Match, MarsAPIState, util::{responder::JsonResponder, error::ApiErrorResponder, r#macro::unwrap_helper}}; | ||
|
||
#[get("/<match_id>")] | ||
pub async fn matches( | ||
state: &State<MarsAPIState>, | ||
match_id: &str | ||
) -> Result<JsonResponder<Match>, ApiErrorResponder> { | ||
let match_id = match_id.to_lowercase(); | ||
let cached_match = | ||
unwrap_helper::return_default!( | ||
state.match_cache.get(&state.database, &match_id).await, | ||
Err(ApiErrorResponder::validation_error()) | ||
); | ||
Ok(JsonResponder::ok(cached_match)) | ||
} | ||
|
||
pub fn mount(rocket_build: Rocket<Build>) -> Rocket<Build> { | ||
rocket_build.mount("/mc/matches", routes![matches]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ pub mod report; | |
pub mod leaderboard; | ||
pub mod tag; | ||
pub mod perks; | ||
pub mod r#match; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters