From 774f98b69a9dc88bc6c3cbf0c422b5a4168187ff Mon Sep 17 00:00:00 2001 From: ai-bot Date: Thu, 1 Oct 2026 12:51:24 +0000 Subject: [PATCH] Initialize SQLite on application startup --- app.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app.py b/app.py index a328e68..8ec4e1e 100644 --- a/app.py +++ b/app.py @@ -6,6 +6,8 @@ import os from pathlib import Path from urllib.parse import urlsplit +from database import initialize_database + ROOT = Path(__file__).resolve().parent STATIC_FILES = { @@ -57,6 +59,9 @@ class AppHandler(BaseHTTPRequestHandler): def main(): + database_path = os.environ.get("DATABASE_PATH", "data/helsesjekk.sqlite3") + initialize_database(database_path) + port = int(os.environ.get("PORT", "8080")) if not 1 <= port <= 65535: raise ValueError("PORT must be between 1 and 65535")