Skip to content

JSON

Chimera supports JSON files as input to define mock API routes.

  • Directoryproject/
    • data.json

Run chimera with data.json

Terminal window
chimera-cli --path data.json http

This runs chimera-cli as a mock http server at port 8080 using data.json

{
"api/v2/data": [
{
"id": 1,
"created_on": "25-03-24",
"mssg": "It does not do to dwell on dreams and forget to live. - Albus Dumbledore"
},
{
"id": 2,
"created_on": "09-11-24",
"mssg": "I solemnly swear that I am up to no good. - Marauder's Map"
}
],
"products": [
{
"id": 8,
"name": "Nimbus 2000"
},
{
"id": 4,
"name": "Invisibility Cloak"
},
{
"id": 6,
"name": "Time-Turner"
},
{
"id": 7,
"name": "Marauder's Map"
},
{
"id": 1,
"name": "Elder Wand"
},
{
"id": 2,
"name": "Golden Snitch"
},
{
"id": 3,
"name": "Horcrux Locket"
}
],
"api/products": [
{
"id": 80,
"name": "Butterbeer"
},
{
"id": 40,
"name": "Bertie Bott's Every Flavour Beans"
},
{
"id": 60,
"name": "Chocolate Frog"
},
{
"id": 70,
"name": "Pumpkin Pasties"
},
{
"id": 10,
"name": "Fizzing Whizzbees"
},
{
"id": 20,
"name": "Treacle Tart"
},
{
"id": 30,
"name": "Cauldron Cake"
}
]
}