From 0a64b76687b8e375a590f95e9cc581269558655c Mon Sep 17 00:00:00 2001 From: Mahmoud Rahbar Azad Date: Fri, 26 Oct 2018 22:35:42 +0200 Subject: [PATCH] updated Readme.md --- .gitignore | 2 +- Readme.md | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c2caa08..34e2d5e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ go.sum -build/ +builds/ .idea/* *.iml \ No newline at end of file diff --git a/Readme.md b/Readme.md index ad2ffe0..a895482 100644 --- a/Readme.md +++ b/Readme.md @@ -29,11 +29,16 @@ Usage of hetzner-sb-notifier: set serve http -serve-http-port int set serve http port (default 8080) + -output + set output: one of table, json (default table) ```` ## Http mode -## Example +In HTTP mode (app started with flag -serve-http) hetzner-sb-notifier runs continuously and can be queried via simple HTTP GET request. +CLI parameters are translated to camel case. For example min-hdd-count becomes minHddCount + +## CLI-Example ./hetzner-sb-notifier --max-price 77 --min-ram 128 --min-hdd-count 2 --min-hdd-size 4096 ```` @@ -44,6 +49,23 @@ Got 545 offers. Filtered offers: 3 SB73-910394| 128 GB| 3x 2 TB (6144)| Intel Xeon E5-1650V2 (12518)| 73.00 €| 86.13| 03h 04m|ECC, Ent. HDD, iNIC ```` +## HTTP-Example + +./hetzner-sb-notifier -serve-http +```` +Running http server on address :8080 + +Got request: GET /?minRam=256&output=table HTTP/1.1 +Host: localhost:8080 +Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 +Accept-Encoding: gzip, deflate, br +Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7 +Cache-Control: max-age=0 +Connection: keep-alive +Upgrade-Insecure-Requests: 1 +User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36 +```` + ## Build The Go project uses Go Modules and can be easily build with the wrapper script build.sh: