Refactor httpz server into library with cmdliner CLI
- Move server logic from bin/ to lib/server.ml for library use
- Extract request parsing to lib/request_parse.ml (avoids circular dep)
- Use cmdliner for CLI with proper man pages and help text
- Use magic-mime for MIME type detection instead of hardcoded types
- Add xdge for XDG base directory config file support
- Add tomlt for TOML configuration file parsing
- Config file at ~/.config/httpz/config.toml with:
- port, root, max_content_length, max_header_size, etc.
- CLI flags override config file, config overrides defaults
Binary is now a minimal ~120 line wrapper around the library.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>