ENV VAR for VUE DIST
This commit is contained in:
@@ -192,6 +192,7 @@ class TunneldRunnerSio:
|
|||||||
port,
|
port,
|
||||||
)
|
)
|
||||||
self._app = APIRouter()
|
self._app = APIRouter()
|
||||||
|
self._vue_dist = os.getenv("VUE_DIST")
|
||||||
self._vue_app = FastAPI(
|
self._vue_app = FastAPI(
|
||||||
title="iOS Device Management API",
|
title="iOS Device Management API",
|
||||||
lifespan=lifespan,
|
lifespan=lifespan,
|
||||||
@@ -1644,11 +1645,11 @@ class TunneldRunnerSio:
|
|||||||
|
|
||||||
self._vue_app.include_router(self._app, prefix="/api")
|
self._vue_app.include_router(self._app, prefix="/api")
|
||||||
self._vue_app.mount(
|
self._vue_app.mount(
|
||||||
"/assets", StaticFiles(directory="../../front-end/dist/spa/assets", html=True), name="vue")
|
"/assets", StaticFiles(directory=self._vue_dist, html=True), name="vue")
|
||||||
|
|
||||||
@self._vue_app.get("/{full_path:path}")
|
@self._vue_app.get("/{full_path:path}")
|
||||||
async def serve_vue_app(full_path: str):
|
async def serve_vue_app(full_path: str):
|
||||||
return FileResponse("../../front-end/dist/spa/index.html")
|
return FileResponse(self._vue_dist + "index.html")
|
||||||
|
|
||||||
def _run_app(self) -> None:
|
def _run_app(self) -> None:
|
||||||
# api = uvicorn.Server(uvicorn.Config(self._app, host=self.host, port=49151, log_level="info"))
|
# api = uvicorn.Server(uvicorn.Config(self._app, host=self.host, port=49151, log_level="info"))
|
||||||
|
|||||||
Reference in New Issue
Block a user