mirror of
https://github.com/woodchen-ink/random-api-go.git
synced 2025-07-18 05:42:01 +08:00
- Updated docker-compose.yml to mount logs directory. - Changed BASE_URL environment variable to point to the new API endpoint. - Refactored main.go to implement a structured App type, improving initialization and graceful shutdown. - Enhanced config management with JSON loading and environment variable support. - Added monitoring capabilities in api_handler for logging request metrics. - Introduced new metrics display in index.html with corresponding CSS styles for better visualization.
17 lines
337 B
JSON
17 lines
337 B
JSON
{
|
|
"server": {
|
|
"port": ":5003",
|
|
"read_timeout": "30s",
|
|
"write_timeout": "30s",
|
|
"max_header_bytes": 1048576
|
|
},
|
|
"storage": {
|
|
"data_dir": "/root/data",
|
|
"stats_file": "/root/data/stats.json",
|
|
"log_file": "/var/log/random-api/server.log"
|
|
},
|
|
"api": {
|
|
"base_url": "",
|
|
"request_timeout": "10s"
|
|
}
|
|
} |