Skip to content

Comment on Show HN: Caffeine – Minimum viable back end for prototyping

Comments

Feature request: supply .json file via command line to pre-load data into the in-memory database.

Taking it even further; how about persisting the data in the file?

Sometimes your prototype will need some pre-added data so I think this might be useful.

qw

I have used WireMock in the past that supports pre-defined mocks. It can be run both locally and as a service (I only ran it locally)

http://wiremock.org/

It's more complex than Caffeine, but it has a lot of options.

It can also run as a proxy and generate the mocks from actual http requests passing through the proxy

aw4yOP

currently there are two implementation for the database "behind": in memory or with postgres, both with zero config (except for starting an instance of postgres, in the second case!). it can be easily extended to use files as persistence, good idea :)

regarding the pre-population, you can just make a quick script with curl that will add some data after you run the service. any thought?

Thats code folks would have to write instead of focusing on the MVP, it would be better if this loaded it by convention.

SQLite could also be a good option

My first thought too, but I guess it's also very easy to hand-roll an init_data.sh script with a bunch of POST curls to populate the DB.

aw4yOP

exactly!

Can probably do that with some `jq` and CURL magic already!

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.