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:
fiatjaf
2020-09-14 16:03:25 -03:00
parent f452b9c00d
commit f01028eac7
72 changed files with 473 additions and 582 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
from flask import Blueprint
from quart import Blueprint
example_ext: Blueprint = Blueprint("example", __name__, static_folder="static", template_folder="templates")
+3 -3
View File
@@ -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)
+2 -2
View File
@@ -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 = [
{