21 lines
608 B
Python
21 lines
608 B
Python
from flask import Blueprint, g, jsonify, current_app
|
|
from typing import cast
|
|
from app.utils.typed_flask import CoCFlask
|
|
|
|
# from app.services.appwrite_client import AppWriteClient
|
|
|
|
# type cast flask to my custom flask app so the app.api methods are available in the IDE / typed correctly.
|
|
app = cast(CoCFlask,current_app)
|
|
|
|
# blueprint def
|
|
main_bp = Blueprint("main", __name__, url_prefix="/")
|
|
|
|
|
|
@main_bp.route("/health", methods=["GET", "POST"])
|
|
def health():
|
|
return app.api.ok({"status":"up"})
|
|
|
|
@main_bp.route("/me", methods=["GET", "POST"])
|
|
def me():
|
|
return app.api.ok({"user":g.appwrite_user})
|
|
|