backend: make the data directory and the artifacts from the frontend customizable using environment variables

Signed-off-by: lucasew <lucas59356@gmail.com>
This commit is contained in:
lucasew 2024-01-19 17:13:09 -03:00
parent e3503d6617
commit 5b26d2a686
4 changed files with 16 additions and 14 deletions

View file

@ -14,7 +14,7 @@ from apps.openai.main import app as openai_app
from apps.web.main import app as webui_app
from apps.rag.main import app as rag_app
from config import ENV
from config import ENV, WEB_DIR
class SPAStaticFiles(StaticFiles):
@ -58,4 +58,4 @@ app.mount("/openai/api", openai_app)
app.mount("/rag/api/v1", rag_app)
app.mount("/", SPAStaticFiles(directory="../build", html=True), name="spa-static-files")
app.mount("/", SPAStaticFiles(directory=str(WEB_DIR), html=True), name="spa-static-files")