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 roles import Permissions, has_permission
|
||||
from admin_router import router as admin_router
|
||||
|
||||
logger = structlog.get_logger(__name__)
|
||||
|
||||
@@ -62,8 +63,6 @@ async def lifespan(app: FastAPI):
|
||||
BLOCKED_HOSTS = []
|
||||
|
||||
init_db()
|
||||
|
||||
app.include_router(auth_router)
|
||||
|
||||
if args.test:
|
||||
await run_test_mode()
|
||||
@@ -417,9 +416,13 @@ ACTIVATE_PASS_HTML = """
|
||||
# Create app with lifespan
|
||||
app = FastAPI(title="ZernMC Launcher Server", lifespan=lifespan)
|
||||
|
||||
# Add logging middleware
|
||||
# Add Logging middleware
|
||||
app.add_middleware(LoggingMiddleware)
|
||||
|
||||
# Register routers
|
||||
app.include_router(auth_router)
|
||||
app.include_router(admin_router)
|
||||
|
||||
|
||||
# Monkey patch to catch invalid HTTP requests
|
||||
original_data_received = HttpToolsProtocol.data_received
|
||||
|
||||
Reference in New Issue
Block a user