The Game Log Parser API is designed to parse game log files and provide detailed game statistics. This API is built using Rust with the Axum framework and follows best practices for REST API development.
- Rust and Cargo installed on your machine. You can install Rust using rustup.
- The log file (
qgames.log) should be present in thedatadirectory.
To run the project, follow these steps:
-
Clone the repository:
git clone [email protected]:nekelpatrick/rust_quake_log_parser.git cd game-log-parser
-
Build the project:
cargo build
-
Run the server:
cargo run
The server will start at http://localhost:8080.
- URL:
/api/healthCheck - Method: GET
- Description: Checks if the API service is running.
- Response:
{ "status": "ok", "message": "API Services" }
- URL:
/api/logs - Method: GET
- Description: Parses the game log file and returns the game statistics.
- Query Parameters:
debug(optional, boolean): If set totrue, the endpoint content will be printed in the console.
- Response:
{ "games": [ // List of games with their statistics ], "player_rankings": [ // List of player rankings ], "total_deaths_by_means": { // Death counts by means } }
To run the tests, use the following command:
cargo testThis will execute all the test cases defined in the project to ensure the functionality works as expected.
To enable debugging, add the debug=true query parameter to the /api/logs endpoint. This will print the parsed log content to the console:
curl "http://localhost:8080/api/logs?debug=true"