Settings

Theme

Show HN: Self-hosted API for CRUD-ing JSON data

timokats.xyz

3 points by tiemster 3 months ago · 2 comments · 1 min read

Reader

Self-hosted API for CRUD-ing JSON data in GO. No setup required. Perfect for quick data storage tasks (or e.g. mocking an API).

The API is based on your JSON structure. So the example below is for CRUD-ing [key1][key2] in file.json. The value (which can be anything) is then added to the body of the request. Moreover, there are helper functions for appending and incrementing values.

  DELETE/PUT/GET: /api/file/key1/key2/...
tiempie 3 months ago

Nice. So sending {"username": "tom"} to /api/test/users will create > test.json with {"users": {"username": "tom"}} ?

  • tiemsterOP 3 months ago

    Yes! And you can use "append" mode for use cases like these also. Then the value will be added as a list object. So:

      {users: [{"username": "tom"}, {"username": "tim"}]}

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection