flare / config_provider.py
ciyidogan's picture
Update config_provider.py
14b6ee2 verified
raw
history blame
504 Bytes
import json
from pathlib import Path
from fastapi import Depends
CONFIG_FILE = Path("service_config.json")
class ServiceConfig:
def __init__(self):
with open(CONFIG_FILE, "r") as f:
self.data = json.load(f)
def get_current_project(self):
if not self.data['projects']:
raise ValueError("No projects configured")
# For simplicity, just return the first project
return self.data['projects'][0]
def get_config():
return ServiceConfig()