Features
apitwin provides a rich set of features for mocking, stubbing, and proxying APIs. This section covers each feature in detail.
| Feature | Description |
|---|---|
| Conditions | Route requests to different responses based on body, query, header, or path values |
| Named Parameters | Extract values from URL paths with {name} syntax |
| Directory-Based Stubs | Full CRUD with one JSON file per resource |
| Dynamic File Resolution | {source.field} placeholders in stub file paths |
| Template Tokens | {{uuid}}, {{now}}, {{timestamp}}, and {{ref:...}} in responses |
| Cross-Endpoint References | Reference data from other stub files with filtering and transformation |
| Array Processing | $each / $template syntax for iterating over collections and reshaping data |
| Type Conversion | $as directive to convert between types (e.g. merge an array of objects into one) |
| Response Transitions | Time-based state progression across cases |
| Record Mode | Proxy a real API, save responses, replay offline |
| Hot Reload | Edit config, see changes on the next request |
| API Prefix | Strip path prefixes before matching and forwarding |
| Runtime State Isolation | Gitignored mirror dir keeps mutations out of git; --ephemeral for throwaway sessions |
| Devtool UI | Browser dashboard for inspecting routes, testing requests, and watching config changes |