migrate from flask to quart.
also remove all flaskiness from static file serving. and reference all vendored scripts on the base tempĺate for simplicity.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from flask import Blueprint
|
||||
from quart import Blueprint
|
||||
|
||||
|
||||
example_ext: Blueprint = Blueprint("example", __name__, static_folder="static", template_folder="templates")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from flask import g, render_template
|
||||
from quart import g, render_template
|
||||
|
||||
from lnbits.decorators import check_user_exists, validate_uuids
|
||||
from lnbits.extensions.example import example_ext
|
||||
@@ -7,5 +7,5 @@ from lnbits.extensions.example import example_ext
|
||||
@example_ext.route("/")
|
||||
@validate_uuids(["usr"], required=True)
|
||||
@check_user_exists()
|
||||
def index():
|
||||
return render_template("example/index.html", user=g.user)
|
||||
async def index():
|
||||
return await render_template("example/index.html", user=g.user)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# import json
|
||||
# import requests
|
||||
|
||||
from flask import jsonify
|
||||
from quart import jsonify
|
||||
from http import HTTPStatus
|
||||
|
||||
from lnbits.extensions.example import example_ext
|
||||
@@ -15,7 +15,7 @@ from lnbits.extensions.example import example_ext
|
||||
|
||||
|
||||
@example_ext.route("/api/v1/tools", methods=["GET"])
|
||||
def api_example():
|
||||
async def api_example():
|
||||
"""Try to add descriptions for others."""
|
||||
tools = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user