lnbits-legend/lnbits/extensions/bleskomat/__init__.py
matthewcroughan 36e92765d3 treewide: use StaticFiles() rather than rel path
This commit is not exhaustive, and it is a trend in this codebase to not
use StaticFiles() and instead use relative paths. This means the code
cannot run anywhere other than the source code directory, as it will not
find the files it is looking for
2022-07-08 11:06:26 +01:00

26 lines
694 B
Python

from fastapi import APIRouter
from starlette.staticfiles import StaticFiles
from lnbits.db import Database
from lnbits.helpers import template_renderer
db = Database("ext_bleskomat")
bleskomat_static_files = [
{
"path": "/bleskomat/static",
"app": StaticFiles(packages=[("lnbits", "extensions/bleskomat/static")]),
"name": "bleskomat_static",
}
]
bleskomat_ext: APIRouter = APIRouter(prefix="/bleskomat", tags=["Bleskomat"])
def bleskomat_renderer():
return template_renderer([StaticFiles(packages=[("lnbits", "extensions/bleskomat/static/templates")])])
from .lnurl_api import * # noqa
from .views import * # noqa
from .views_api import * # noqa