Key Value store with time revision - VD test.
- Routing for managing API end points.
- Controller to handle API request and input filtering.
- Model for abstraction on MongoDB.
- Modular design to further abstract the responsibility of each module.
- Logging to files for debugging and inspection on production server.
- Test cases to ensure code and application reliability.
- Indexes on key and timestamp to improve MongoDB query performance.
- Configured logging base on environment between developement and production.
Starting server
DEBUG=key-val-store:* npm start
Running test cases
npm test
Adding key
curl -d '{"MyKey":"My Value"}' -H "Content-Type: application/json" http://127.0.0.1:3000/objects
Retrieving key
curl http://127.0.0.1:3000/objects/MyKey
Retrieving key by timestamp
curl http://127.0.0.1:3000/objects/MyKey?timestamp=1484477495
2 Key added within a same second will only return one of them upon query the key.