feat(#20): Adds Enable UI feature to disable serving the UI

This commit is contained in:
Elia el Lazkani 2024-12-25 21:56:16 +01:00
parent 29b233ebfb
commit 38520c6e2a
3 changed files with 13 additions and 11 deletions

View file

@ -3,6 +3,7 @@ Server:
port: 8000
scheme: http
cors: False
enable_ui: True
static_folder: ui/
Database:

2
poetry.lock generated
View file

@ -1136,4 +1136,4 @@ watchdog = ["watchdog (>=2.3)"]
[metadata]
lock-version = "2.0"
python-versions = "^3.10"
content-hash = "cdbbaa8d1f22a904c7cc3fa51f5fbaf5f19a99f2f5fd9715adfe7abf766b05f0"
content-hash = "64cb750d8d7e5ad3e10d7f53f311971c09849247b0ea3d82a66a7f368837f63f"

View file

@ -31,6 +31,7 @@ class Web:
CORS(self.app)
def setup_routes(self):
if self.handler.configuration.get("Server", None)["enable_ui"]:
self.app.add_url_rule(
"/", "/", self.handler.index, methods=["GET"], defaults={"path": ""}
)