allways mount frontend files at port 8001

- files were previously only mounted when in production mode
This commit is contained in:
Mose Müller 2023-08-17 16:41:40 +02:00
parent a2ce2e1116
commit fb6fac5f9a
2 changed files with 8 additions and 10 deletions

View File

@ -4,6 +4,6 @@ from confz import BaseConfig, EnvSource
class OperationMode(BaseConfig): # type: ignore class OperationMode(BaseConfig): # type: ignore
environment: Literal["development"] | Literal["production"] = "production" environment: Literal["development"] | Literal["production"] = "development"
CONFIG_SOURCES = EnvSource(allow=["ENVIRONMENT"]) CONFIG_SOURCES = EnvSource(allow=["ENVIRONMENT"])

View File

@ -8,7 +8,6 @@ from fastapi.staticfiles import StaticFiles
from loguru import logger from loguru import logger
from pydase import DataService from pydase import DataService
from pydase.config import OperationMode
from pydase.version import __version__ from pydase.version import __version__
@ -115,7 +114,6 @@ class WebAPI:
def service_properties() -> dict[str, Any]: def service_properties() -> dict[str, Any]:
return self.service.serialize() return self.service.serialize()
if OperationMode().environment == "production":
app.mount( app.mount(
"/", "/",
StaticFiles( StaticFiles(