Skip to content

Quick Start

This guide helps you get started by installing Chimera and running your first mock server.

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.

  1. Install via Cargo

    Terminal window
    cargo install chimera-cli --locked

    See Installation Guide for binaries, build from source and more.

  2. Setup Run Diectory

    • Directoryproject/
      • data.json

    Use a sample data.json from here

  3. Run Chimera

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

    You should now see Chimera running a http API mock server on http://localhost:8080 by default.

    Use flags like --port, --latency, or --page for customization. See the full CLI options in the

  4. Test it

    Test route /api/v2/data

    Terminal window
    curl -X GET http://localhost:8080/api/v2/data -H "Accept: application/json"

    Test route /products

    Terminal window
    curl -X GET http://localhost:8080/products -H "Accept: application/json"

    Test route /api/products

    Terminal window
    curl -X GET http://localhost:8080/api/products -H "Accept: application/json"

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"
}
]
}