feat: add server status endpoint #2736
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Original Request: #2735
A new endpoint has been created:
GET http://127.0.0.1:5000/api/v1/statusRequest example:
This endpoint requires the
invoice keyof a user.Different responses are returned depending if the
invoice keybelongs to an admin user or not.Response for regular user (non admin):
{ "server_time": 1728985995, "up_time": 209, "version": "1.0.0rc4" }Response for admin:
{ "server_time": 1728986208, "up_time": 47, "version": "1.0.0rc4", "funding_source": "LNbitsWallet", "funding_source_error": null, "funding_source_balance_msat": 3105756 }{ "server_time": 1728986321, "up_time": 17, "version": "1.0.0rc4", "funding_source": "LNbitsWallet", "funding_source_error": "Unable to connect to https://demo.lnbits.com.", "funding_source_balance_msat": 0 }VoidWallet):{ "server_time": 1728985819, "up_time": 33, "version": "1.0.0rc4", "funding_source": "VoidWallet", "funding_source_error": null, "funding_source_balance_msat": 0 }