feat: update offlineshop extension

This commit is contained in:
Stefan Stammberger
2021-09-16 19:42:05 +02:00
parent 24bb2e0dc9
commit e3c7ca0726
10 changed files with 138 additions and 101 deletions
+6 -1
View File
@@ -95,9 +95,14 @@ def register_routes(app: FastAPI) -> None:
try:
ext_module = importlib.import_module(f"lnbits.extensions.{ext.code}")
ext_route = getattr(ext_module, f"{ext.code}_ext")
ext_statics = getattr(ext_module, f"{ext.code}_static_files")
for s in ext_statics:
app.mount(s["path"], s["app"], s["name"])
app.include_router(ext_route)
except Exception:
except Exception as e:
print(str(e))
raise ImportError(
f"Please make sure that the extension `{ext.code}` follows conventions."
)