Skip to content
Snippets Groups Projects
Commit 05748bdf authored by leehuwuj's avatar leehuwuj
Browse files

refactor code

parent d60b3c5a
No related branches found
No related tags found
No related merge requests found
...@@ -38,16 +38,15 @@ if environment == "dev": ...@@ -38,16 +38,15 @@ if environment == "dev":
return RedirectResponse(url="/docs") return RedirectResponse(url="/docs")
def mount_static_files(directory, path):
if os.path.exists(directory):
app.mount(path, StaticFiles(directory=directory), name=f"{directory}-static")
# Mount the data files to serve the file viewer # Mount the data files to serve the file viewer
if os.path.exists("data"): mount_static_files("data", "/api/files/data")
app.mount("/api/files/data", StaticFiles(directory="data"), name="data-static")
# Mount the output files from tools # Mount the output files from tools
if os.path.exists("tool-output"): mount_static_files("tool-output", "/api/files/tool-output")
app.mount(
"/api/files/tool-output",
StaticFiles(directory="tool-output"),
name="tool-output-static",
)
app.include_router(chat_router, prefix="/api/chat") app.include_router(chat_router, prefix="/api/chat")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment