fastdoi/config.py
mxr612 4d84586a9d 0. Configs
1. MySQL Connection
2. FastGPT database uploader
2024-08-19 22:13:16 +08:00

21 lines
414 B
Python

# Load Cogfigs
import os
import json
# Get the absolute path of the main file
main_file_path = os.path.abspath(__file__)
# Get the directory in which the main file resides
MAIN_DIRECTORY = os.path.dirname(main_file_path)
def load_config():
# Open and load the JSON file
with open(MAIN_DIRECTORY+"/config.json", 'r') as file:
data = json.load(file)
return data
__CONFIG__ = load_config()