oleg-server
v1.0.7
Published
JSON-backed REST API for local testing
Downloads
403
Readme
oleg-json-server
JSON-backed REST API for local testing
Install
npm i -g oleg-serverRun
mini-json-server --file db.json --port 3000Seed fake data
Generate deterministic fake data from schema.json:
mini-json-server --file db.json --port 3000 --seed 42 --count 20Example db.json
{
"dossiers": [
{ "id": "1", "status": "OK", "message": "Dossier valide" }
],
"users": [
{ "id": "1", "name": "Awa" }
]
}Routes (automatic)
GET /:collectionlistGET /:collection/:idonePOST /:collectioncreatePUT /:collection/:idreplacePATCH /:collection/:idupdateDELETE /:collection/:idremove
Query filters
Exact match on fields:
GET /dossiers?status=OKHealth
GET /healthNotes
- IDs are auto-generated sequentially based on existing numeric IDs
- Data is stored back into the JSON file after write operations
- Seeding requires a
schema.jsonnext to yourdb.json
