Hi Sven and all,
Disclaimer: just another rather not important query (mainly for fun so don’t hesitate to tell me to use the node packages instead ;-) )
To show API to students, I sometimes use https://jsonplaceholder.typicode.com. It’s nice to play with client requests. I wonder if this would be interesting to have such tools in Pharo/Zn. Maybe it exists already somehow (for Teapot eventually) ?
From their GitHub, I discovered json-server + lowdb (based on lowdash) => all nodes packages.
It uses a db file db.json and I like such simple « databases ». I know they're not real db.
To me, it could nearly be to me an elegant personal db even if I think this is mostly used to test API’s.
Indeed, It’s often used in conjunction with node package faker (https://github.com/marak/Faker.js/ (https://github.com/marak/Faker.js/).
I would like to use that to generate static websites from Ecstatic.
The placeholder default website has limitations. For instance, the following request creates a new post (but then you cannot see the result if you query for posts just after)
I wanted to go past the limitation of the placeholder site (the db.json cannot be written). I can of course use the node package but you know :) Might be not so straight to port though.
So there are probably three open questions in this post:
1) lowdb (I know this is not a database but it’s handy and I’d like such usage in static website generation in conjunction with Ecstatic). Any already existing experiments maybe ? I don’t think Voyage can do that.
2) the API json-server based on routes (maybe a job for Teapot) ?
3) the faker package as a fun exercice.
What others think ? My priority would go for having some kind of lowdb (and I’m pretty sure there are experiments around that - It reminds me a bit sandstonedb from Ramon http://onsmalltalk.com/sandstonedb-simple-activerecord-style-persistence-in-squeak.
I knew but forget about it !
Will definitely look again at it. Is it using a json file as db too ? I guess that be easy to add if not. I’ll look at it soon.
Any feedback about faker ? That’d be a fun project to do in Pharo.
There are lots of them. I don’t know which one to look at more in detail (js, ruby, python, php... ?).
Anybody knows what’s the most « complete » or elegant ?
Uhm right, I always forget and use the old way (with #contentReader: ).
Thanks for the information Sven,
|Free forum by Nabble||Edit this page|