2024-11-10 17:21:25 -08:00
|
|
|
from flask import Blueprint, make_response, request
|
2024-12-10 18:18:40 -08:00
|
|
|
import flask_migrate
|
2024-11-02 12:33:27 -07:00
|
|
|
|
2024-12-09 17:03:43 -08:00
|
|
|
from app_db import app, connect_celery_with_app, connect_db_with_app
|
2024-11-02 12:33:27 -07:00
|
|
|
import login
|
|
|
|
import schedule
|
|
|
|
import team
|
2024-11-03 14:29:59 -08:00
|
|
|
from spec import spec
|
2024-11-15 19:37:41 -08:00
|
|
|
import user
|
2024-11-24 10:47:45 -08:00
|
|
|
import events
|
2024-12-10 10:22:32 -08:00
|
|
|
import match
|
2024-11-02 12:33:27 -07:00
|
|
|
|
2024-12-10 18:18:40 -08:00
|
|
|
connect_db_with_app(None)
|
2024-12-09 17:03:43 -08:00
|
|
|
connect_celery_with_app()
|
2024-11-02 12:33:27 -07:00
|
|
|
|
|
|
|
api = Blueprint("api", __name__, url_prefix="/api")
|
|
|
|
api.register_blueprint(login.api_login)
|
|
|
|
api.register_blueprint(schedule.api_schedule)
|
|
|
|
api.register_blueprint(team.api_team)
|
2024-11-15 19:37:41 -08:00
|
|
|
api.register_blueprint(user.api_user)
|
2024-11-24 10:47:45 -08:00
|
|
|
api.register_blueprint(events.api_events)
|
2024-12-10 10:22:32 -08:00
|
|
|
api.register_blueprint(match.api_match)
|
2024-11-02 12:33:27 -07:00
|
|
|
|
|
|
|
@api.get("/debug/set-cookie")
|
|
|
|
@api.post("/debug/set-cookie")
|
|
|
|
def debug_set_cookie():
|
|
|
|
res = make_response()
|
|
|
|
for key, value in request.args.items():
|
|
|
|
res.set_cookie(key, value)
|
|
|
|
return res, 200
|
|
|
|
|
|
|
|
app.register_blueprint(api)
|
2024-11-03 14:29:59 -08:00
|
|
|
spec.register(app)
|