Merge branch 'FastAPI' of https://github.com/arcbtc/lnbits into FastAPI
This commit is contained in:
commit
4120a51e0c
2 changed files with 41 additions and 44 deletions
|
|
@ -65,7 +65,7 @@ def create_app(config_object="lnbits.settings") -> FastAPI:
|
||||||
register_routes(app)
|
register_routes(app)
|
||||||
# register_commands(app)
|
# register_commands(app)
|
||||||
register_async_tasks(app)
|
register_async_tasks(app)
|
||||||
# register_exception_handlers(app)
|
register_exception_handlers(app)
|
||||||
|
|
||||||
return app
|
return app
|
||||||
|
|
||||||
|
|
@ -150,11 +150,11 @@ def register_async_tasks(app):
|
||||||
async def stop_listeners():
|
async def stop_listeners():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def register_exception_handlers(app):
|
def register_exception_handlers(app: FastAPI):
|
||||||
@app.errorhandler(Exception)
|
@app.exception_handler(Exception)
|
||||||
async def basic_error(request: Request, err):
|
async def basic_error(request: Request, err):
|
||||||
print("handled error", traceback.format_exc())
|
print("handled error", traceback.format_exc())
|
||||||
etype, value, tb = sys.exc_info()
|
etype, _, tb = sys.exc_info()
|
||||||
traceback.print_exception(etype, err, tb)
|
traceback.print_exception(etype, err, tb)
|
||||||
exc = traceback.format_exc()
|
exc = traceback.format_exc()
|
||||||
return template_renderer().TemplateResponse("error.html", {"request": request, "err": err})
|
return template_renderer().TemplateResponse("error.html", {"request": request, "err": err})
|
||||||
|
|
|
||||||
|
|
@ -1,51 +1,48 @@
|
||||||
aiofiles==0.6.0
|
aiofiles==0.7.0
|
||||||
async-generator==1.10
|
anyio==3.3.1
|
||||||
attrs==20.3.0
|
asgiref==3.4.1
|
||||||
|
asyncio==3.4.3
|
||||||
|
attrs==21.2.0
|
||||||
bech32==1.2.0
|
bech32==1.2.0
|
||||||
bitstring==3.1.7
|
bitstring==3.1.9
|
||||||
blinker==1.4
|
cerberus==1.3.4
|
||||||
brotli==1.0.9
|
certifi==2021.5.30
|
||||||
cerberus==1.3.3
|
charset-normalizer==2.0.6
|
||||||
certifi==2020.12.5
|
click==8.0.1
|
||||||
click==7.1.2
|
ecdsa==0.17.0
|
||||||
ecdsa==0.16.1
|
embit==0.4.9
|
||||||
embit==0.2.1
|
environs==9.3.3
|
||||||
environs==9.3.2
|
fastapi==0.68.1
|
||||||
h11==0.12.0
|
h11==0.12.0
|
||||||
h2==4.0.0
|
httpcore==0.13.7
|
||||||
hpack==4.0.0
|
httptools==0.2.0
|
||||||
httpcore==0.12.3
|
httpx==0.19.0
|
||||||
httpx==0.17.1
|
idna==3.2
|
||||||
hypercorn==0.11.2
|
importlib-metadata==4.8.1
|
||||||
hyperframe==6.0.0
|
jinja2==3.0.1
|
||||||
idna==3.1
|
|
||||||
itsdangerous==1.1.0
|
|
||||||
jinja2==2.11.3
|
|
||||||
lnurl==0.3.6
|
lnurl==0.3.6
|
||||||
markupsafe==1.1.1
|
markupsafe==2.0.1
|
||||||
marshmallow==3.11.1
|
marshmallow==3.13.0
|
||||||
outcome==1.1.0
|
outcome==1.1.0
|
||||||
priority==1.3.0
|
psycopg2-binary==2.9.1
|
||||||
pydantic==1.8.1
|
pydantic==1.8.2
|
||||||
pyngrok==5.0.5
|
pypng==0.0.21
|
||||||
pypng==0.0.20
|
|
||||||
pyqrcode==1.2.1
|
pyqrcode==1.2.1
|
||||||
pyscss==1.3.7
|
pyscss==1.3.7
|
||||||
python-dotenv==0.17.0
|
python-dotenv==0.19.0
|
||||||
quart==0.14.1
|
pyyaml==5.4.1
|
||||||
quart-compress==0.2.1
|
|
||||||
quart-cors==0.4.0
|
|
||||||
quart-trio==0.7.0
|
|
||||||
represent==1.6.0.post0
|
represent==1.6.0.post0
|
||||||
rfc3986==1.4.0
|
rfc3986==1.5.0
|
||||||
shortuuid==1.0.1
|
shortuuid==1.0.1
|
||||||
six==1.15.0
|
six==1.16.0
|
||||||
sniffio==1.2.0
|
sniffio==1.2.0
|
||||||
sortedcontainers==2.3.0
|
|
||||||
sqlalchemy==1.3.23
|
sqlalchemy==1.3.23
|
||||||
sqlalchemy-aio==0.16.0
|
sqlalchemy-aio==0.16.0
|
||||||
toml==0.10.2
|
sse-starlette==0.6.2
|
||||||
trio==0.16.0
|
starlette==0.14.2
|
||||||
typing-extensions==3.7.4.3
|
typing-extensions==3.10.0.2
|
||||||
werkzeug==1.0.1
|
uvicorn==0.15.0
|
||||||
wsproto==1.0.0
|
uvloop==0.16.0
|
||||||
|
watchgod==0.7
|
||||||
|
websockets==10.0
|
||||||
|
zipp==3.5.0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue