Inzibat (from Turkish, meaning "Military Police") is a lightweight, fully-customizable HTTP mock server designed for microservices testing and development. Built in Go and powered by Fiber, it provides a fast and simple way to simulate downstream services through declarative configuration files.
Perfect for frontend development, backend integration testing, and CI/CD pipelinesβconfigure your mock responses in JSON, TOML, or YAML without writing a single line of server code.
- Inzibat πͺ
- Lightweight HTTP mock server implemented in Go
- Config-driven (JSON, TOML, YAML) for easy scenario definition
- Fast β built on top of Fiber (which uses fasthttp)
- Simple, declarative API for defining routes and responses
- For Frontend Teams: Get predictable API responses for your UI development without waiting for the backend.
- For Backend Teams: Isolate your service during integration testing by mocking downstream dependencies.
- For CI Pipelines: Run reliable end-to-end tests by simulating third-party APIs.
- No-Code Scenarios: Implement complex mock behavior without writing a single line of server code.
This is the easiest way to get inzibat for most users.
- Go to the Releases Page.
- Download the archive matching your OS and architecture (e.g.,
inzibat_linux_amd64.tar.gz). - Extract the archive and move the
inzibatbinary to a directory in your system'sPATH.
# Example for Linux/macOS
tar -xzf inzibat_linux_amd64.tar.gz
sudo mv inzibat /usr/local/bin/brew tap lynicis/tap
brew install inzibatchoco install inzibatscoop bucket add inzibat https://github.com/lynicis/scoop-bucket.git
scoop install inzibatPre-built .deb and .rpm packages are attached to each release.
Debian / Ubuntu
curl -LO https://github.com/lynicis/inzibat/releases/latest/download/inzibat_linux_amd64.deb
sudo dpkg -i inzibat_linux_amd64.debFedora / CentOS / RHEL
sudo rpm -i https://github.com/lynicis/inzibat/releases/latest/download/inzibat_linux_amd64.rpmIf you have Go 1.25+ installed, you can build inzibat from source.
go install github.com/lynicis/inzibat@latestThis installs the latest version to your $GOPATH/bin directory.
For development or custom builds:
git clone https://github.com/Lynicis/inzibat.git
cd inzibat
go build -o inzibat .This creates a local inzibat binary in the project directory.
Get a mock server running in under 30 seconds.
Create a file named inzibat.json (or inzibat.yml, inzibat.toml) in your current directory:
# inzibat.yml
port: 8080
routes:
- path: /api/hello
method: GET
response:
status_code: 200
headers:
Content-Type: application/json
body: '{"message": "Hello, World!"}'Run Inzibat:
inzibat start
# or use the short alias
inzibat sThe server will start on port 8080 (or the port specified in your config).
In another terminal, send a request:
curl http://localhost:8080/api/helloYou should receive:
{"message": "Hello, World!"}Inzibat provides a powerful CLI for managing routes and starting the server interactively.
Start the mock server with the start command:
# Start with default config (inzibat.json in current directory)
inzibat start
# Use the short alias
inzibat s
# Specify a custom config file
inzibat start --config /path/to/config.yml
inzibat start -c /path/to/config.yml
# Use the global config stored at ~/.inzibat.config.json
inzibat start --globalConfiguration Precedence:
The server reads configuration in the following order:
- File specified by the
--config/-cflag - File specified by the
INZIBAT_CONFIG_FILEenvironment variable inzibat.jsonin the current working directory
Use the --global (-g) flag to bypass this order and load the global config at ~/.inzibat.config.json.
Create new routes interactively using the create command:
# Launch interactive route creation (saves to inzibat.json in current directory)
inzibat create
# Or use the short alias
inzibat c
# Create route in a custom config file
inzibat create --config /path/to/config.json
inzibat create -c /path/to/config.json
# Create route in the global config file (~/.inzibat.config.json)
inzibat create --global
inzibat create -gThe interactive form guides you through:
- Setting the route path and HTTP method
- Choosing between mock responses or proxy routes
- Configuring response status codes, headers, and body
- Setting up proxy targets for client routes
Configuration Precedence:
Routes are saved to the configuration file in the following order:
- File specified by the
--config/-cflag - File specified by the
INZIBAT_CONFIG_FILEenvironment variable inzibat.jsonin the current working directory~/.inzibat.config.jsonif--global/-gflag is used
View all configured routes:
# List all routes from inzibat.json in current directory
inzibat list
# Or use the short aliases
inzibat ls
inzibat l
# List routes from a custom config file
inzibat list --config /path/to/config.json
inzibat list -c /path/to/config.json
# List routes from the global config file (~/.inzibat.config.json)
inzibat list --global
inzibat list -gThis displays all routes from your configuration file in a structured, easy-to-read format.
Configuration Precedence:
Routes are read from the configuration file in the following order:
- File specified by the
--config/-cflag - File specified by the
INZIBAT_CONFIG_FILEenvironment variable inzibat.jsonin the current working directory~/.inzibat.config.jsonif--global/-gflag is used
For convenience, all commands have shorter aliases:
| Command | Aliases |
|---|---|
start |
start-server, server, s |
create |
create-route, c |
list |
list-routes, ls, l |
Inzibat features a Request Recorder that intercepts and stores incoming HTTP requests and responses flowing through the mock/proxy server, allowing you to export them as raw JSON or convert them directly into native Inzibat mock configurations for testing.
Start the server with the --record (or -r) flag to enable the request recorder:
# Start server with recording enabled
inzibat start --record
# Or
inzibat start -rUse the record command group to interact with the recorded session:
# List all captured requests (IDs, methods, paths, status codes, duration)
inzibat record list
# Or
inzibat record ls
# Export the raw session data to a JSON file
inzibat record export -o session.json
# Convert and export the session specifically into the Inzibat mock format
inzibat record export --format inzibat -o my-mocks.jsonTo clear all captured requests from the session store:
# Clear the captured requests
inzibat record clearWhen recording is enabled, you can also manage the recording store programmatically via the built-in HTTP Admin API:
GET /_inzibat/recorder/entriesβ Returns all captured entries in the session.GET /_inzibat/recorder/sessionβ Returns the current recorder session with metadata.POST /_inzibat/recorder/clearβ Clears the recorder store.
Run the test suite:
# Run all tests
go test ./... -v
# Run tests with coverage
go test ./... -cover
# Run tests for a specific package
go test ./handler -vInzibat supports configuration files in JSON, TOML, and YAML formats.
{
"$schema": "https://raw.githubusercontent.com/lynicis/inzibat/refs/heads/master/examples/inzibat.schema.json",
"serverPort": 8080,
"concurrency": 5,
"circuitBreaker": {
"enabled": true,
"failureThreshold": 5,
"minimumRequests": 10,
"openTimeoutMs": 30000,
"halfOpenMaxRequests": 2,
"successThreshold": 2
},
"routes": [
{
"method": "GET",
"path": "/proxy/users",
"requestTo": {
"method": "GET",
"host": "http://localhost:8081",
"path": "/users",
"passWithRequestHeaders": true,
"passWithRequestBody": false,
"inErrorReturn500": false,
"circuitBreaker": {
"enabled": true,
"failureThreshold": 3
}
}
},
{
"method": "GET",
"path": "/mock/health",
"fakeResponse": {
"statusCode": 200,
"body": {
"status": "ok"
}
}
}
]
}- Mock Routes: Use
fakeResponseto return predefined status, headers, and body - Proxy Routes: Use
requestToto forward requests to upstream services
- Circuit breaker applies only to proxy routes (
requestTo) - Failure signal is network errors and
5xxresponses;4xxresponses do not trip the breaker - You can configure breaker globally (
circuitBreaker) and override per-route (requestTo.circuitBreaker)
Contributions are welcome! We appreciate your help in making Inzibat better.
-
Fork the repository and clone your fork
-
Create a feature branch (
git checkout -b feature/my-new-feature) -
Make your changes and add tests for any new behavior
-
Run the tests to ensure everything passes:
go test ./... -v -
Commit your changes with clear, descriptive messages
-
Push to your fork and open a Pull Request
- Follow Go best practices and conventions
- Add tests for new features and bug fixes
- Update documentation as needed
- Keep commits focused and atomic
- Write clear commit messages
For bug reports or feature requests, please open an issue with:
- A clear description of the problem or feature request
- Steps to reproduce (for bugs)
- Expected vs. actual behavior
- Environment details (OS, Go version, etc.)
See ROADMAP.md for planned features and improvements.
We welcome feedback, feature suggestions, and contributions to help advance Inzibat's capabilities. If you notice gaps in feature coverage or want to propose an enhancement, please open an issue or Pull Request!
This project is licensed under the MIT License β see the LICENSE file for details.