Skip to content

Commit

Permalink
add rest sample
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas von Dein committed Dec 20, 2024
1 parent b3b0f37 commit da6ebcf
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ reasons:
- filtering using tags
- encryption of entries
- templates for custom output for maximum flexibility
- includes a tiny web server, which serves a restful API

**anydb** can do all the things you can do with skate:

Expand Down Expand Up @@ -110,6 +111,20 @@ anydb ls -m template -T "{{ .Value }}"
eval $(anydb get foo -m template -T "key='{{ .Key }}' value='{{ .Value }}' ts='{{ .Created}}'")
echo "$key: $value"

# run the restful api server
anydb serve

# post a new key
curl -X PUT localhost:8787/anydb/v1/ \
-H 'Content-Type: application/json' \
-d '{"key":"foo","val":"bar"}'

# retrieve it
curl localhost:8787/anydb/v1/foo

# list keys
curl localhost:8787/anydb/v1/

# it comes with a manpage builtin
anydb man
```
Expand Down

0 comments on commit da6ebcf

Please sign in to comment.