feat: switch from Quart to FastAPI part I
This commit is contained in:
+12
-15
@@ -1,22 +1,19 @@
|
||||
from quart import Blueprint
|
||||
from fastapi.routing import APIRouter
|
||||
|
||||
from lnbits.db import Database
|
||||
|
||||
db = Database("database")
|
||||
|
||||
core_app: Blueprint = Blueprint(
|
||||
"core",
|
||||
__name__,
|
||||
template_folder="templates",
|
||||
static_folder="static",
|
||||
static_url_path="/core/static",
|
||||
)
|
||||
|
||||
|
||||
from .views.api import * # noqa
|
||||
from .views.generic import * # noqa
|
||||
from .views.public_api import * # noqa
|
||||
from .tasks import register_listeners
|
||||
core_app: APIRouter = APIRouter()
|
||||
|
||||
from lnbits.tasks import record_async
|
||||
|
||||
core_app.record(record_async(register_listeners))
|
||||
from .tasks import register_listeners
|
||||
from .views.api import * # noqa
|
||||
from .views.generic import * # noqa
|
||||
from .views.public_api import * # noqa
|
||||
|
||||
|
||||
@core_app.on_event("startup")
|
||||
def do_startup():
|
||||
record_async(register_listeners)
|
||||
|
||||
Reference in New Issue
Block a user