Allow to start wallet API by cashu --daemon (#243)

* Allow to start wallet API by cashu --daemon

* Provide access to wallet name via settings

* Make format

* Use flag is_eager for daemon option

* add setting api_host

---------

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
This commit is contained in:
sihamon
2023-06-08 14:42:37 +02:00
committed by GitHub
parent 5c820f9469
commit 786fbf2856
6 changed files with 37 additions and 13 deletions

View File

@@ -0,0 +1,13 @@
import uvicorn
from ...core.settings import settings
def start_api_server(port=settings.api_port, host=settings.api_host):
config = uvicorn.Config(
"cashu.wallet.api.app:app",
port=port,
host=host,
)
server = uvicorn.Server(config)
server.run()