add (cached) /api/datapackge endpoint
This commit is contained in:
parent
2fc4006dfa
commit
312f13e254
|
@ -6,7 +6,7 @@ import logging
|
|||
import json
|
||||
import functools
|
||||
from collections import OrderedDict, Counter, deque
|
||||
from typing import List, Dict, Optional, Set, Iterable, Union
|
||||
from typing import List, Dict, Optional, Set, Iterable, Union, Any
|
||||
import secrets
|
||||
import random
|
||||
|
||||
|
@ -23,7 +23,7 @@ class MultiWorld():
|
|||
plando_items: List
|
||||
plando_connections: List
|
||||
er_seeds: Dict[int, str]
|
||||
worlds: Dict[int, "AutoWorld.World"]
|
||||
worlds: Dict[int, Any]
|
||||
is_race: bool = False
|
||||
|
||||
class AttributeProxy():
|
||||
|
|
|
@ -4,14 +4,15 @@ from uuid import UUID
|
|||
from flask import Blueprint, abort
|
||||
|
||||
from ..models import Room
|
||||
from .. import cache
|
||||
|
||||
api_endpoints = Blueprint('api', __name__, url_prefix="/api")
|
||||
|
||||
from . import generate, user # trigger registration
|
||||
|
||||
|
||||
# unsorted/misc endpoints
|
||||
|
||||
|
||||
@api_endpoints.route('/room_status/<suuid:room>')
|
||||
def room_info(room: UUID):
|
||||
room = Room.get(id=room)
|
||||
|
@ -22,3 +23,10 @@ def room_info(room: UUID):
|
|||
"last_port": room.last_port,
|
||||
"last_activity": room.last_activity,
|
||||
"timeout": room.timeout}
|
||||
|
||||
|
||||
@api_endpoints.route('/datapackage')
|
||||
@cache.cached()
|
||||
def get_datapackge():
|
||||
from worlds import network_data_package
|
||||
return network_data_package
|
||||
|
|
Loading…
Reference in New Issue