An in-memory database server using node.js
git clone https://github.com/arpith/tiny-database-server
cd tiny-database-server
npm install && npm start
The server is accessible on http://localhost:4000/
curl http://localhost:4000/set?key=value
curl http://localhost:4000/get?key=name
This will return the value previously stored.
curl http://localhost:4000/get?snapshot=true
This will return a JSON string of the database.
When the server starts up, a persistence client is also started that fetches a snapshot from the server every second and stores it on the filesystem. This file (database.json) is used to populate the database when the server is next started up.
- Install and start the server
- In another terminal window/tab run
npm test