docs: update README and add example configuration files
This commit is contained in:
14
README.md
14
README.md
@@ -96,9 +96,21 @@ cargo run
|
|||||||
cargo build --release
|
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
|
### 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
|
## Project Structure
|
||||||
|
|
||||||
|
|||||||
25
config.json.example
Normal file
25
config.json.example
Normal file
@@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
8
response.json.example
Normal file
8
response.json.example
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"status": "success",
|
||||||
|
"message": "This is an example response from DHL mock server.",
|
||||||
|
"data": {
|
||||||
|
"id": 1,
|
||||||
|
"name": "Test Object"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user