mirror of
https://github.com/pyMC-dev/pyMC_Repeater.git
synced 2026-08-10 10:52:53 +02:00
Add CompanionAPIEndpoints integration in APIEndpoints class
- Introduced CompanionAPIEndpoints to handle routes under /api/companion/*. - Enhanced the APIEndpoints class to create a nested companion object for improved modularity and organization of companion-related API functionality.
This commit is contained in:
@@ -11,6 +11,7 @@ from repeater.config import update_global_flood_policy
|
||||
from .cad_calibration_engine import CADCalibrationEngine
|
||||
from .auth.middleware import require_auth
|
||||
from .auth_endpoints import AuthAPIEndpoints
|
||||
from .companion_endpoints import CompanionAPIEndpoints
|
||||
from pymc_core.protocol import CryptoUtils
|
||||
|
||||
logger = logging.getLogger("HTTPServer")
|
||||
@@ -146,6 +147,9 @@ class APIEndpoints:
|
||||
# Create nested auth object for /api/auth/* routes
|
||||
self.auth = AuthAPIEndpoints()
|
||||
|
||||
# Create nested companion object for /api/companion/* routes
|
||||
self.companion = CompanionAPIEndpoints(daemon_instance, event_loop, self.config)
|
||||
|
||||
def _is_cors_enabled(self):
|
||||
return self.config.get("web", {}).get("cors_enabled", False)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user