Getting started
Install akuma and run your first mock server in under a minute.
Install
cargo install akuma-cli Or build from source:
git clone https://github.com/NumstackPtyLtd/akuma-cli.git
cd akuma-cli
cargo build --release Create a mock server
akuma init my-api This creates a akuma.yml file with example endpoints: a status endpoint, a users list, and a single user lookup.
Start the server
akuma start The server starts at http://localhost:3000 with three endpoints ready to use.
Test it
# Status endpoint (inline response)
curl http://localhost:3000/
# => {"status": "ok", "message": "Akuma server is running"}
# Users list (database-backed)
curl http://localhost:3000/users
# => [{"id": 1, "name": "Example 1", "email": "user1@example.com"}, ...]
# Single user
curl http://localhost:3000/users/1
# => {"id": 1, "name": "Example 1", "email": "user1@example.com"} Edit your config
Open akuma.yml and add your own schemas and endpoints. Restart the server to pick up changes.
name: my-api
port: 3000
schemas:
Category:
properties:
id: number
name: string
Product:
properties:
id: number
name: string
price: float
category: Category # relationship
inStock: boolean
endpoints:
- path: /categories
method: GET
response:
type: array
schema: Category
- path: /products
method: GET
response:
type: array
schema: Product
- path: /products/:id
method: GET
response:
schema: Product Schema names become tables by converting to snake_case and pluralizing, so this creates categories and products tables in SQLite, seeds them with example records, and ensures product categoryId values point to real categories.