domru
domru copied to clipboard
Refactor handlers and introduce API wrapper
- Updated Handler struct to include an API wrapper for better abstraction.
- Added middleware for JSON error handling.
- Refactored Operators and Places handlers to utilize the new API wrapper.
- Simplified Snapshot and Stream handlers to use the API wrapper for upstream requests.
- Removed deprecated token handling logic from handlers.
- Introduced centralized models for accounts, confirmations, cameras, places, and finances.
- Created a new upstream request handling mechanism for better error management.
- Implemented token refresh logic with a dedicated auth package.
- Added constants for API host and user agent.
- Enhanced logging capabilities for upstream requests.