Added Commands Management

This commit is contained in:
2025-10-24 23:02:44 +02:00
parent a4e122f4ea
commit 06aff27cad
26 changed files with 88445 additions and 2 deletions

View File

@@ -0,0 +1,19 @@
from starlette.routing import Mount
def mount_if_not_exists(app, path: str, sub_app):
"""
Mounts a sub-application only if no Mount object already exists
at the specified path in the main application's router.
"""
is_mounted = False
for route in app.router.routes:
if isinstance(route, Mount):
if route.path == path:
is_mounted = True
break
if not is_mounted:
app.mount(path, app=sub_app)