demodb
You are about to give a workshop where you must show how to use a technology and you also need a database for demo purposes, everything is ready, your demo is working and the attendees just need to checkout the initial code.
What could go wrong?
Everything!
Enter demodb
.
demodb
is a lightweight, native dependencies free, in memory database (you can also save data to disk), built with fastify
and lokijs
.
It exposes a nice HTTP API that you can easily consume from the browser or the server, it does not require authentication and can be run everywhere.
Install
npm i demodb -g
Usage
demodb start test
Client usage
npm i demodb
const Demodb = const demodb = 'http://localhost:8081' const col = demodbawait colconst result = await col
Need help?
demodb help
API
The entire API is expose via HTTP, the canonical url is: /db/:collection/:command
. The collection part of the url is the collection name that you are using (like mongo!), the last part is the command you want to run.
The currently supported lokijs
APIs are:
find
method: 'POST' url: '/db/:collection/find' body: your query
findOne
method: 'POST' url: '/db/:collection/findOne' body: your query
insert
method: 'POST' url: '/db/:collection/insert' body: your query
update
method: 'POST' url: '/db/:collection/update' body: your query
remove
method: 'POST' url: '/db/:collection/remove' body: your query
Contributing
If you feel you can help in any way, be it with examples, extra testing, or new features please open a pull request or open an issue.
License
Copyright © 2018 Tomas Della Vedova