Show HN: Self-hosted API for CRUD-ing JSON data(timokats.xyz)
timokats.xyz
Show HN: Self-hosted API for CRUD-ing JSON data
https://timokats.xyz/pages/emmer.php
2 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"}]}
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.