mirror of
https://github.com/Xevion/the-office.git
synced 2025-12-14 12:13:22 -06:00
Commit latest changes to server-side processing system
This commit is contained in:
15
server/data.py
Normal file
15
server/data.py
Normal file
@@ -0,0 +1,15 @@
|
||||
"""
|
||||
data.py
|
||||
|
||||
Manages API quote/character data, caching static responses and reloading from disk.
|
||||
"""
|
||||
import os
|
||||
import json
|
||||
|
||||
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
with open(os.path.join(BASE_DIR, 'data', 'data.json'), 'r', encoding='utf-8') as file:
|
||||
data = json.load(file)
|
||||
|
||||
with open(os.path.join(BASE_DIR, 'data', 'characters.json'), 'r', encoding='utf-8') as file:
|
||||
character_data = json.load(file)
|
||||
|
||||
Reference in New Issue
Block a user