Quick Start
This guide helps you get started by installing Chimera and running your first mock server.
Prerequisites
Section titled “Prerequisites”You need to have Rust installed on your system to build from source or use Cargo. Alternatively, you can use prebuilt binaries for your OS.
Installation
Section titled “Installation”-
Install via Cargo
Terminal window cargo install chimera-cli --lockedSee Installation Guide for binaries, build from source and more.
-
Setup Run Diectory
Directoryproject/
- data.json
Use a sample
data.jsonfrom here -
Run Chimera
Terminal window chimera-cli --path project\data.json httpYou should now see Chimera running a
httpAPI mock server on http://localhost:8080 by default.Use flags like
--port,--latency, or--pagefor customization. See the full CLI options in the- HTTP Usage Guide or do
chimera-cli http --helpfor all flags in thehttpmode - Websocket Usage Guide or do
chimera-cli websocket --helpfor all flags in thewebsocketmode
- HTTP Usage Guide or do
-
Test it
Test route
/api/v2/dataTerminal window curl -X GET http://localhost:8080/api/v2/data -H "Accept: application/json"Test route
/productsTerminal window curl -X GET http://localhost:8080/products -H "Accept: application/json"Test route
/api/productsTerminal window curl -X GET http://localhost:8080/api/products -H "Accept: application/json"
Sample Data File
Section titled “Sample Data File”Save this as data.json in your working directory:
{ "api/v2/data":[ { "id":1, "created_on":"25-03-24", "mssg":"It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for" }, { "id":2, "created_on":"09-11-24", "mssg":"years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, fro" } ], "products": [ { "id":8, "name": "ball" }, { "id":4, "name": "table" } ], "api/products": [ { "id":80, "name": "ball" }, { "id":40, "name": "table" } ]}