File size: 504 Bytes
14b6ee2
 
 
04b94fe
14b6ee2
 
 
 
 
 
 
 
 
 
 
 
04b94fe
 
14b6ee2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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()