A mock API utility service that provides random success/failure responses for testing unreliable external services.
This tool simulates flaky third-party APIs, helping developers test:
- Retry mechanisms
- Error handling
- Circuit breakers
- Fallback strategies
GET /api/v{n}/authorize
Randomly returns:
200with{ "status": "success", "data": { "authorization": true } }403with{ "status": "fail", "data": { "authorization": false } }
POST /api/v{n}/notify
Randomly returns:
204(empty body)504with{ "status": "error", "message": "The service is not available, try again later" }
All responses include a fun X-HTTP-Status-Cat header linking to http.cat.
make up # Start containers
make down # Stop containers
make logs # View logs
make shell # Open shell in containerThe service runs on the reverse-proxy network and is accessible at util.devi.tools when configured with a local reverse proxy.
make test # Run tests inside container- Docker
- Docker Compose
- Make
- External
reverse-proxynetwork
- PHP 8.3
- Nginx (via webdevops/php-nginx image)
- Docker