2021-09-16 19:42:05 +02:00
|
|
|
from fastapi import APIRouter, FastAPI
|
|
|
|
from fastapi.staticfiles import StaticFiles
|
|
|
|
from starlette.routing import Mount
|
2021-08-20 12:44:03 +01:00
|
|
|
|
|
|
|
from lnbits.db import Database
|
2021-09-16 19:42:05 +02:00
|
|
|
from lnbits.helpers import template_renderer
|
2021-08-20 12:44:03 +01:00
|
|
|
|
|
|
|
db = Database("ext_offlineshop")
|
|
|
|
|
2021-09-16 19:42:05 +02:00
|
|
|
offlineshop_static_files = [
|
|
|
|
{
|
|
|
|
"path": "/offlineshop/static",
|
|
|
|
"app": StaticFiles(directory="lnbits/extensions/offlineshop/static"),
|
|
|
|
"name": "offlineshop_static",
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
2021-08-22 20:07:24 +02:00
|
|
|
offlineshop_ext: APIRouter = APIRouter(
|
2021-09-16 19:42:05 +02:00
|
|
|
prefix="/offlineshop",
|
|
|
|
tags=["Offlineshop"],
|
|
|
|
# routes=[
|
|
|
|
# Mount(
|
|
|
|
# "/static",
|
|
|
|
# app=StaticFiles(directory="lnbits/extensions/offlineshop/static"),
|
|
|
|
# name="offlineshop_static",
|
|
|
|
# )
|
|
|
|
# ],
|
2021-08-20 12:44:03 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
2021-09-16 19:42:05 +02:00
|
|
|
def offlineshop_renderer():
|
2021-10-17 18:33:29 +01:00
|
|
|
return template_renderer(["lnbits/extensions/offlineshop/templates"])
|
2021-09-16 19:42:05 +02:00
|
|
|
|
|
|
|
|
2021-08-20 12:44:03 +01:00
|
|
|
from .lnurl import * # noqa
|
2021-09-16 19:42:05 +02:00
|
|
|
from .views import * # noqa
|
|
|
|
from .views_api import * # noqa
|