This commit is contained in:
2025-09-17 10:23:42 +03:00
parent ac84d11215
commit cad21143ea
2 changed files with 9 additions and 1 deletions

View File

@@ -2,10 +2,17 @@ from flask import Flask, request, jsonify
from tinydb import TinyDB, Query, where
from tinydb.operations import set as ops_set
import json
from flask_cors import CORS
import os
app = Flask(__name__)
UI_ORIGIN = os.getenv("UI_ORIGIN", "https://db.northdanubesoft.eu")
CORS(app, resources={r"/*": {"origins": [UI_ORIGIN]}})
# Single TinyDB file for now (can be swapped to per-table later)
DB_PATH = os.getenv("DB_PATH", "db.json")
db = TinyDB(DB_PATH)