From b950efb70354a74d013de9ad985dee497af5236d Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Wed, 1 May 2019 19:37:22 -0400 Subject: [PATCH] added example --- .gitignore | 1 + endstat_conf.example.ron | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 endstat_conf.example.ron diff --git a/.gitignore b/.gitignore index b365619..7149c85 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ target **/*.rs.bk *.ron .vscode/ +!endstat_conf.example.ron diff --git a/endstat_conf.example.ron b/endstat_conf.example.ron new file mode 100644 index 0000000..72b08b5 --- /dev/null +++ b/endstat_conf.example.ron @@ -0,0 +1,40 @@ +#![enable(implicit_some)] +( + refresh_time: 60, + bind_address: "0.0.0.0:8080", + + websites: [ + ( + label: "Basic usage", + endpoints: [ + (label: "Supports HTTPS", endpoint: "https://example.com"), + (label: "Supports HTTP", endpoint: "http://example.com"), + (label: "Supports no redirection", endpoint: "http://google.com", code: 301, follow_redirects: false), + ] + ), + ( + label: "More features!", + base: "http://portquiz.net/", + endpoints: [ + (label: "You can even set a base url"), + (label: "Or use different ports", port: 8080), + ], + ), + ( + label: "Even more stuff!", + endpoints: [ + (label: "Or expect different reponse codes (like 418)", endpoint: "http://error418.net/", code: 418), + (label: "Or bodies!", endpoint: "http://urlecho.appspot.com/echo", body: "None"), + (label: "Or both!", endpoint: "http://urlecho.appspot.com/echo?status=503&Content-Type=text%2Fhtml&body=None", body: "None", code: 503), + ], + ), + ( + label: "Some error messages", + endpoints:[ + (label: "The code doesn't match!", endpoint: "http://example.com/", code: 204), + (label: "The body doesn't match!", endpoint: "http://example.com/", body: "asdf"), + (label: "Here's an error", endpoint: "https://some-invalid-website.arpa") + ] + ), + ] +)