FastAPI application with lazy database initialization to prevent import-time GDBM locking issues.
• HTTP REST API via uvicorn server
• STDIN protocol for pipe/redirect operations
Mode detection based on sys.stdin.isatty() and environment variables.
Unified request handling through handle_*_request functions:
• GET: Document retrieval with raw JSON response
• PUT: Document storage with direct JSON string handling
• DELETE: Document removal with 404 handling
• POST: Administrative operations (keys, dump, flush, stop)
Hierarchical configuration loading:
1. Environment variables override all
2. YAML configuration file
3. Built-in defaults
No configuration file required - pure environment variable operation supported.