From d778a5d37e8a9f6554a49d9ac373e1c807124cfe Mon Sep 17 00:00:00 2001 From: danielvici123 <94993276+danielvici@users.noreply.github.com> Date: Mon, 8 Jun 2026 21:27:16 +0200 Subject: [PATCH] docs: update README and add example configuration files --- README.md | 14 +++++++++++++- config.json.example | 25 +++++++++++++++++++++++++ response.json.example | 8 ++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 config.json.example create mode 100644 response.json.example diff --git a/README.md b/README.md index 1f98058..9bb754d 100644 --- a/README.md +++ b/README.md @@ -96,9 +96,21 @@ cargo run cargo build --release ``` +### Release Assets + +When downloading a release, you will find: +- The `dhl` binary (Linux) or `dhl.exe` (Windows). +- `config.json`: An example configuration file. +- `response.json`: An example response file. + +Simply place the binary and the two JSON files in the same folder and start the application. + ### CI/CD -This project includes a Gitea Actions workflow that automatically builds the binary when a version tag (e.g., `v1.0.0`) is pushed to the repository. +This project includes a Gitea Actions workflow that automatically: +1. Builds the application for **Linux** and **Windows**. +2. Packages them into `dhl-linux.tar.gz` and `dhl-windows.zip` respectively, including example configuration files. +3. Creates a Gitea Release with these assets whenever a version tag (e.g., `v0.5.0`) is pushed. ## Project Structure diff --git a/config.json.example b/config.json.example new file mode 100644 index 0000000..2d9b3c8 --- /dev/null +++ b/config.json.example @@ -0,0 +1,25 @@ +{ + "host": "0.0.0.0", + "port": 3000, + "routes": [ + { + "path": "/", + "response_file": "response.json", + "status_code": 200 + }, + { + "path": "/api/test", + "response_file": "response.json", + "status_code": 201 + } + ], + "masking": { + "enabled": true, + "headers": ["authorization", "x-api-key", "cookie"] + }, + "tls": { + "enabled": false, + "cert_path": "cert.pem", + "key_path": "key.pem" + } +} diff --git a/response.json.example b/response.json.example new file mode 100644 index 0000000..650f667 --- /dev/null +++ b/response.json.example @@ -0,0 +1,8 @@ +{ + "status": "success", + "message": "This is an example response from DHL mock server.", + "data": { + "id": 1, + "name": "Test Object" + } +}