From de9c3667772c0ac3a7ba1cee3e7be24813361122 Mon Sep 17 00:00:00 2001 From: TwiN Date: Wed, 19 Oct 2022 16:51:04 -0400 Subject: [PATCH] docs: Add `Keeping your configuration small` section --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/README.md b/README.md index e3448a6e..c17adca5 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,7 @@ Like this project? Please consider [sponsoring me](https://github.com/sponsors/T - [Reloading configuration on the fly](#reloading-configuration-on-the-fly) - [Endpoint groups](#endpoint-groups) - [Exposing Gatus on a custom port](#exposing-gatus-on-a-custom-port) + - [Keeping your configuration small](#keeping-your-configuration-small) - [Badges](#badges) - [Uptime](#uptime) - [Health](#health) @@ -1513,6 +1514,43 @@ web: ``` +### Keeping your configuration small +While not specific to Gatus, you can leverage YAML anchors to create a default configuration. +If you have a large configuration file, this should help you keep things clean. + +
+ Example + +```yaml +default-endpoint: &defaults + group: core + interval: 5m + client: + insecure: true + timeout: 30s + conditions: + - "[STATUS] == 200" + +endpoints: + - name: anchor-example-1 + <<: *defaults # This will merge the configuration under &defaults with this endpoint + url: "https://example.org" + + - name: anchor-example-2 + <<: *defaults + group: example # This will override the group defined in &defaults + url: "https://example.com" + + - name: anchor-example-3 + <<: *defaults + url: "https://twin.sh/health" + conditions: # This will override the conditions defined in &defaults + - "[STATUS] == 200" + - "[BODY].status == UP" +``` +
+ + ### Badges #### Uptime ![Uptime 1h](https://status.twin.sh/api/v1/endpoints/core_blog-external/uptimes/1h/badge.svg)