Import config from .env

This commit is contained in:
dylan
2025-04-12 01:49:07 +02:00
parent e9369aa230
commit f74dfbaab3
4 changed files with 8 additions and 3 deletions

3
.env.example Normal file
View File

@ -0,0 +1,3 @@
API_URI=
API_KEY=
API_TEAM=

2
app.py
View File

@ -1,3 +1,5 @@
import os
from flask import Flask
app = Flask(__name__)

View File

@ -9,12 +9,11 @@ class Config:
with environment variables when available.
"""
def __init__(self, config_file_path: str = "config.yaml"):
def __init__(self):
"""
Initialize the configuration manager.
Args:
config_file_path: Path to the YAML configuration file. Defaults to "config.yaml".
"""
# Load environment variables from .env file if it exists
load_dotenv()

View File

@ -21,4 +21,5 @@ typing-inspection==0.4.0
typing_extensions==4.13.2
urllib3==2.4.0
Werkzeug==3.1.3
Flask==3.1.0
Flask==3.1.0
python-dotenv=1.1.0