mirror of
https://github.com/transformerlab/transformerlab-api.git
synced 2025-04-19 19:36:18 +03:00
change directory to webapp from static
This commit is contained in:
2
api.py
2
api.py
@@ -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")
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")):
|
||||
|
||||
Reference in New Issue
Block a user