add cors
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user