@codeforamerica/safety-net-blueprint-mock-server
v1.0.0
Published
Mock API server for Safety Net API development and testing
Downloads
90
Keywords
Readme
@codeforamerica/safety-net-blueprint-mock-server
Mock API server for Safety Net API development and testing
Installation
npm install @codeforamerica/safety-net-blueprint-mock-serverWhat It Does
An Express-based mock API server that auto-discovers OpenAPI specs, creates SQLite databases, and seeds them from example files. Use it for frontend development without a production backend.
- Auto-discovers all
*-openapi.yamlspecs - Creates per-spec SQLite databases with full CRUD support
- Seeds databases from
*-openapi-examples.yamlfiles - Supports search, pagination, and filtering
- Includes Swagger UI for interactive API exploration
CLI Commands
These commands are installed as bin scripts. Run them via npm scripts in your package.json or with npx.
safety-net-mock
Start the mock API server.
"scripts": {
"mock": "safety-net-mock --specs=./resolved"
}safety-net-swagger
Start the Swagger UI server.
"scripts": {
"swagger": "safety-net-swagger --specs=./resolved"
}Environment Variables
| Variable | Default | Description |
|----------|---------|-------------|
| MOCK_SERVER_HOST | localhost | Server bind address |
| MOCK_SERVER_PORT | 1080 | Server port |
| SKIP_VALIDATION | false | Skip spec validation on startup |
Documentation
See the Safety Net Blueprint documentation for full guides and reference.
