Merge pull request #435 from arcbtc/FastAPI

Cleanup and black
This commit is contained in:
Arc
2021-11-26 05:59:10 +00:00
committed by GitHub
70 changed files with 317 additions and 615 deletions
+4 -2
View File
@@ -1,6 +1,7 @@
import asyncio
import datetime
from http import HTTPStatus
from urllib.parse import urlparse
from fastapi import HTTPException
from starlette.requests import Request
@@ -15,8 +16,9 @@ from ..tasks import api_invoice_listeners
@core_app.get("/.well-known/lnurlp/{username}")
async def lnaddress(username: str, request: Request):
from lnbits.extensions.lnaddress.lnurl import lnurl_response
domain = request.client.host
return await lnurl_response(username, domain)
domain = urlparse(str(request.url)).netloc
return await lnurl_response(username, domain, request)
@core_app.get("/public/v1/payment/{payment_hash}")