From 6531080a02642d5b0a221ac285f120631eebf15c Mon Sep 17 00:00:00 2001 From: velvettear Date: Thu, 2 Feb 2023 10:03:55 +0100 Subject: [PATCH] updated readme --- README.md | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 172711a..3611614 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,39 @@ # worklog -simple workday recording with a basic rest api \ No newline at end of file +simple workday recording with a basic rest api + + +## endpoints + +| method | url | arguments | description | +| ------ | --- | --------- | ----------- | +| `get` | /csv| from=DD.MM.YYYY
to=DD.MM.YYYY | get recordings (in range) as csv | +| `get` | /json| from=DD.MM.YYYY
to=DD.MM.YYYY | get recordings (in range) as json | +| `get` | /today | | get aggregated recordings for today as json (if any) | +| `post` | /start | | start a new recording | +| `post` | /stop | | stop the current recording (if any) | + +**note:** +the api uses basic authentication so each request has to include an `Authorization` request header. + +## examples + +**start a new recording:** +curl -X POST -u username:password http://localhost:3333/start + +**stop the current recording:** +curl -X POST -u username:password http://localhost:3333/stop + +**get all recordings as json:** +curl -u username:password http://localhost:3333/json + +**get all recordings for january 2023 as csv:** +curl -u username:password http://localhost:3333/csv?from=01.01.2023&to=31.01.2023 + +## configuration + +configuration is entirely done inside the file `config.yml`. +you can specify the location of the config file with the optional argument `--config` or `-c` when starting the server. +otherwise the program will try to find a config file at the following locations: +- `$HOME/.config/worklog/config.yml` +- `$PWD/config.yml`