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
This commit is contained in:
matthewcroughan
2022-07-08 11:06:26 +01:00
parent 49bd5ad26b
commit 36e92765d3
11 changed files with 21 additions and 23 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ db = Database("ext_splitpayments")
splitpayments_static_files = [
{
"path": "/splitpayments/static",
"app": StaticFiles(directory="lnbits/extensions/splitpayments/static"),
"app": StaticFiles(packages=[("lnbits", "extensions/splitpayments/static")]),
"name": "splitpayments_static",
}
]
@@ -22,7 +22,7 @@ splitpayments_ext: APIRouter = APIRouter(
def splitpayments_renderer():
return template_renderer(["lnbits/extensions/splitpayments/templates"])
return template_renderer([StaticFiles(packages=[("lnbits", "extensions/splitpayments/static/templates")])])
from .tasks import wait_for_paid_invoices