File size: 410 Bytes
fc7b4a9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from pathlib import Path
import yaml


def load_config():
    """
    Load server configs from YAML file.
    """
    # Define path first
    config_path = Path(__file__).parent.parent / "config" / "server_config.yml"

    if not config_path.exists():
        raise FileNotFoundError(f"Configuration file not found: {config_path}")

    with open(config_path, "r") as file:
        return yaml.safe_load(file)