From 4e9b382dd94dd922eb14b3f619abbcef890460fc Mon Sep 17 00:00:00 2001 From: Alexander Myasoedov Date: Wed, 10 May 2023 18:56:25 +0300 Subject: [PATCH] feat(Pass optional app to create_service): --- langcorn/server/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/langcorn/server/api.py b/langcorn/server/api.py index e8b8057..4c044c2 100644 --- a/langcorn/server/api.py +++ b/langcorn/server/api.py @@ -108,11 +108,11 @@ async def handler(request: request_cls, http_request: Request): return handler -def create_service(*lc_apps, auth_token: str = ""): +def create_service(*lc_apps, auth_token: str = "", app: FastAPI = None): # Make local modules discoverable sys.path.append(os.path.dirname(__file__)) logger.info("Creating service") - app = FastAPI() + app = app or FastAPI() endpoints = ["/docs"] _authenticate_or_401 = Depends(authenticate_or_401(auth_token=auth_token))