feat(server): connect admin_router to FastAPI app
This commit is contained in:
+6
-3
@@ -27,6 +27,7 @@ from fastapi.responses import StreamingResponse
|
|||||||
|
|
||||||
from auth import get_current_user, router as auth_router, init_db, verify_jwt
|
from auth import get_current_user, router as auth_router, init_db, verify_jwt
|
||||||
from roles import Permissions, has_permission
|
from roles import Permissions, has_permission
|
||||||
|
from admin_router import router as admin_router
|
||||||
|
|
||||||
logger = structlog.get_logger(__name__)
|
logger = structlog.get_logger(__name__)
|
||||||
|
|
||||||
@@ -63,8 +64,6 @@ async def lifespan(app: FastAPI):
|
|||||||
|
|
||||||
init_db()
|
init_db()
|
||||||
|
|
||||||
app.include_router(auth_router)
|
|
||||||
|
|
||||||
if args.test:
|
if args.test:
|
||||||
await run_test_mode()
|
await run_test_mode()
|
||||||
yield
|
yield
|
||||||
@@ -417,9 +416,13 @@ ACTIVATE_PASS_HTML = """
|
|||||||
# Create app with lifespan
|
# Create app with lifespan
|
||||||
app = FastAPI(title="ZernMC Launcher Server", lifespan=lifespan)
|
app = FastAPI(title="ZernMC Launcher Server", lifespan=lifespan)
|
||||||
|
|
||||||
# Add logging middleware
|
# Add Logging middleware
|
||||||
app.add_middleware(LoggingMiddleware)
|
app.add_middleware(LoggingMiddleware)
|
||||||
|
|
||||||
|
# Register routers
|
||||||
|
app.include_router(auth_router)
|
||||||
|
app.include_router(admin_router)
|
||||||
|
|
||||||
|
|
||||||
# Monkey patch to catch invalid HTTP requests
|
# Monkey patch to catch invalid HTTP requests
|
||||||
original_data_received = HttpToolsProtocol.data_received
|
original_data_received = HttpToolsProtocol.data_received
|
||||||
|
|||||||
Reference in New Issue
Block a user