I want to make a web app for viewing, creating, and modifying entries saved to a local file. I will use it on my old budget Android phone, and I want it to be as performant as I can possibly make it.
@cvennevik Cool. And while you can use the file system directly, of course, Kitten does come with a built-in database that you can use via pure JavaScript.
That’s valid Kitten code that persists an array of entries and then updates one (again, automatically persisting the change to an append-only JavaScript log).
@aral I'm planning on storing the data in a plain JSON file, so I can easily sync it between devices and potentially create new (non-JavaScript?) apps to work with it!
@cvennevik Makes sense. You could always use the internal database to make updates easy and then store a JSON serialised copy into a file for portability.
(Much easier than persisting JSON updates manually.)
@cvennevik In fact, come to think of it, you don’t even have to save the JSON file. You can just have a route that runs the JSON.stringify and returns the JSON.
@cvennevik …And, in case you do decide to go this route, to make it easier for you, I just added .json() and .jsonFile() response helpers to the response objects passed to Kitten routes :)
Add comment