Open source
MockForge
A multi-tenant mock API gateway driven by one YAML file
About
MockForge is a mock API server that simulates several backend services and simple CRUD data from one YAML file. It routes requests by hostname or path prefix, updates in-memory data on write requests and returns different responses based on conditions. It reloads when the configuration file changes, without a restart. Data is kept in memory only.
Features
- Multi-tenant routing by hostname or path prefix
- Stateful in-memory CRUD with POST, PUT, PATCH and DELETE
- Rules on params, query, headers and body with ==, !=, contains, exists and !exists
- Hot reload of the config file without a restart
- Permissive CORS headers on every response
Requirements
A recent stable Rust toolchain to build from source (verified with 1.96); or Node.js for the npm wrapper
Install
cargo install --git https://github.com/Ankara-Software/mockforgenpm install -g mockforge-gatewayUsage
mockforge --config mockforge.yaml --port 8080curl http://localhost:8080/auth/userscurl -X POST -H "Content-Type: application/json" -d '{"name": "Alice"}' http://localhost:8080/auth/usersLinks
- GitHub repository
- https://github.com/Ankara-Software/mockforge
- Report an issue
- https://github.com/Ankara-Software/mockforge/issues
- Security policy
- SECURITY.md
- License file
- LICENSE (MIT)
- Last update

