Live data from Hacker News

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

timokats.xyz

1–3 of 3 posts

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

#1
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/...

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

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

#3
post #2

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"}]}