Hacker News new | ask | show | jobs
Show HN: Self-hosted API for CRUD-ing JSON data (timokats.xyz)
3 points by tiemster 252 days ago
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/...
1 comments

Nice. So sending {"username": "tom"} to /api/test/users will create > test.json with {"users": {"username": "tom"}} ?
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"}]}