mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-03-07 07:03:44 -08:00
WebHost: Add CORS headers to API Endpoints (#5777)
This commit is contained in:
@@ -2,10 +2,20 @@
|
||||
from typing import List, Tuple
|
||||
|
||||
from flask import Blueprint
|
||||
from flask_cors import CORS
|
||||
|
||||
from ..models import Seed, Slot
|
||||
|
||||
api_endpoints = Blueprint('api', __name__, url_prefix="/api")
|
||||
cors = CORS(api_endpoints, resources={
|
||||
r"/api/datapackage/*": {"origins": "*"},
|
||||
r"/api/datapackage": {"origins": "*"},
|
||||
r"/api/datapackage_checksum/*": {"origins": "*"},
|
||||
r"/api/room_status/*": {"origins": "*"},
|
||||
r"/api/tracker/*": {"origins": "*"},
|
||||
r"/api/static_tracker/*": {"origins": "*"},
|
||||
r"/api/slot_data_tracker/*": {"origins": "*"}
|
||||
})
|
||||
|
||||
|
||||
def get_players(seed: Seed) -> List[Tuple[str, str]]:
|
||||
|
||||
@@ -6,6 +6,7 @@ waitress>=3.0.2
|
||||
Flask-Caching>=2.3.0
|
||||
Flask-Compress==1.18 # pkg_resources can't resolve the "backports.zstd" dependency of >1.18, breaking ModuleUpdate.py
|
||||
Flask-Limiter>=3.12
|
||||
Flask-Cors>=6.0.2
|
||||
bokeh>=3.6.3
|
||||
markupsafe>=3.0.2
|
||||
setproctitle>=1.3.5
|
||||
|
||||
Reference in New Issue
Block a user