init
This commit is contained in:
commit
69bf22c9ec
21 changed files with 778 additions and 0 deletions
36
__init__.py
Normal file
36
__init__.py
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
from fastapi import APIRouter
|
||||
from starlette.staticfiles import StaticFiles
|
||||
|
||||
from lnbits.db import Database
|
||||
from lnbits.helpers import template_renderer
|
||||
from lnbits.tasks import catch_everything_and_restart
|
||||
|
||||
db = Database("ext_nostrclient")
|
||||
|
||||
nostrclient_static_files = [
|
||||
{
|
||||
"path": "/nostrclient/static",
|
||||
"app": StaticFiles(directory="lnbits/extensions/nostrclient/static"),
|
||||
"name": "nostrclient_static",
|
||||
}
|
||||
]
|
||||
|
||||
nostrclient_ext: APIRouter = APIRouter(prefix="/nostrclient", tags=["nostrclient"])
|
||||
|
||||
|
||||
def nostr_renderer():
|
||||
return template_renderer(["lnbits/extensions/nostrclient/templates"])
|
||||
|
||||
|
||||
from .views import * # noqa
|
||||
from .views_api import * # noqa
|
||||
|
||||
from .tasks import init_relays, subscribe_events
|
||||
|
||||
|
||||
def nostrclient_start():
|
||||
loop = asyncio.get_event_loop()
|
||||
loop.create_task(catch_everything_and_restart(init_relays))
|
||||
# loop.create_task(catch_everything_and_restart(send_data))
|
||||
# loop.create_task(catch_everything_and_restart(receive_data))
|
||||
loop.create_task(catch_everything_and_restart(subscribe_events))
|
||||
Loading…
Add table
Add a link
Reference in a new issue