Skip to content

Commit

Permalink
fix: only attempt to mount static files dir (for chatUI) if already g…
Browse files Browse the repository at this point in the history
…enerated (#991)
  • Loading branch information
cpacker authored Feb 12, 2024
1 parent cad3504 commit 440961b
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions memgpt/server/rest_api/static_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ async def get_response(self, path: str, scope):


def mount_static_files(app: FastAPI):
app.mount(
"/",
SPAStaticFiles(
directory=os.path.join(os.getcwd(), "memgpt", "server", "static_files"),
html=True,
),
name="spa-static-files",
)
static_files_path = os.path.join(os.getcwd(), "memgpt", "server", "static_files")
if os.path.exists(static_files_path):
app.mount(
"/",
SPAStaticFiles(
directory=static_files_path,
html=True,
),
name="spa-static-files",
)

0 comments on commit 440961b

Please sign in to comment.