change directory to webapp from static

This commit is contained in:
ali asaria
2025-04-14 15:35:42 -04:00
parent 1d52eac5b7
commit 216bda38bb
3 changed files with 4 additions and 4 deletions

2
api.py
View File

@@ -361,7 +361,7 @@ async def server_worker_health(request: Request):
return result
# Add an endpoint that serves the static files in the ./static directory:
# Add an endpoint that serves the static files in the ~/.transformerlab/webapp directory:
app.mount("/", StaticFiles(directory=dirs.STATIC_FILES_DIR, html=True), name="application")

View File

@@ -4,7 +4,7 @@ set -eu
ENV_NAME="transformerlab"
TLAB_DIR="$HOME/.transformerlab"
TLAB_CODE_DIR="${TLAB_DIR}/src"
TLAB_STATIC_WEB_DIR="${TLAB_DIR}/static"
TLAB_STATIC_WEB_DIR="${TLAB_DIR}/webapp"
MINICONDA_ROOT=${TLAB_DIR}/miniconda3
CONDA_BIN=${MINICONDA_ROOT}/bin/conda

View File

@@ -61,8 +61,8 @@ else:
print(f"Source code directory is set to: {os.path.join(HOME_DIR, 'src')}")
TFL_SOURCE_CODE_DIR = os.path.join(HOME_DIR, "src")
# TFL_STATIC_FILES_DIR is TFL_HOME_DIR/static
STATIC_FILES_DIR = os.path.join(HOME_DIR, "static")
# TFL_STATIC_FILES_DIR is TFL_HOME_DIR/webapp
STATIC_FILES_DIR = os.path.join(HOME_DIR, "webapp")
os.makedirs(name=STATIC_FILES_DIR, exist_ok=True)
# if there is no index.html file in the static directory, create blank one
if not os.path.exists(os.path.join(STATIC_FILES_DIR, "index.html")):