From 498eceeb469514cc07e7c0099819b41defebc3b0 Mon Sep 17 00:00:00 2001 From: Eneko Illarramendi Date: Wed, 22 Apr 2020 21:49:31 +0200 Subject: [PATCH] feat: use dynamic root in api docs --- lnbits/core/templates/core/_api_docs.html | 6 +++--- .../diagonalley/templates/diagonalley/_api_docs.html | 6 +++--- lnbits/extensions/tpos/templates/tpos/_api_docs.html | 6 +++--- .../extensions/withdraw/templates/withdraw/_api_docs.html | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lnbits/core/templates/core/_api_docs.html b/lnbits/core/templates/core/_api_docs.html index 689be7d..000be86 100644 --- a/lnbits/core/templates/core/_api_docs.html +++ b/lnbits/core/templates/core/_api_docs.html @@ -15,7 +15,7 @@
Returns 201 CREATED (application/json)
{"checking_id": <string>, "payment_request": <string>}
Curl example
- curl -X POST http://127.0.0.1:5000/api/v1/payments -d '{"out": false, "amount": <int>, "memo": <string>}' -H "X-Api-Key: {{ wallet.inkey }}" -H "Content-type: application/json" + curl -X POST {{ request.url_root }}api/v1/payments -d '{"out": false, "amount": <int>, "memo": <string>}' -H "X-Api-Key: {{ wallet.inkey }}" -H "Content-type: application/json" @@ -30,7 +30,7 @@
Returns 201 CREATED (application/json)
{"checking_id": <string>}
Curl example
- curl -X POST http://127.0.0.1:5000/api/v1/payments -d '{"out": true, "bolt11": <string>}' -H "X-Api-Key: {{ wallet.adminkey }}" -H "Content-type: application/json" + curl -X POST {{ request.url_root }}api/v1/payments -d '{"out": true, "bolt11": <string>}' -H "X-Api-Key: {{ wallet.adminkey }}" -H "Content-type: application/json" @@ -44,7 +44,7 @@
Returns 200 OK (application/json)
{"paid": <bool>}
Curl example
- curl -X GET http://127.0.0.1:5000/api/v1/payments/<checking_id> -H "X-Api-Key: {{ wallet.inkey }}" -H "Content-type: application/json" + curl -X GET {{ request.url_root }}api/v1/payments/<checking_id> -H "X-Api-Key: {{ wallet.inkey }}" -H "Content-type: application/json" diff --git a/lnbits/extensions/diagonalley/templates/diagonalley/_api_docs.html b/lnbits/extensions/diagonalley/templates/diagonalley/_api_docs.html index 573c8b8..8ba8c40 100644 --- a/lnbits/extensions/diagonalley/templates/diagonalley/_api_docs.html +++ b/lnbits/extensions/diagonalley/templates/diagonalley/_api_docs.html @@ -30,7 +30,7 @@
Returns 201 CREATED (application/json)
Product JSON list
Curl example
- curl -X GET http://127.0.0.1:5000/diagonalley/api/v1/diagonalley/stall/products/<indexer_id> + curl -X GET {{ request.url_root }}diagonalley/api/v1/diagonalley/stall/products/<indexer_id> @@ -43,7 +43,7 @@
Returns 201 CREATED (application/json)
{"checking_id": <string>,"payment_request": <string>}
Curl example
- curl -X POST http://127.0.0.1:5000/diagonalley/api/v1/diagonalley/stall/order/<indexer_id> -d '{"id": <product_id&>, "email": <customer_email>, "address": <customer_address>, "quantity": 2, "shippingzone": 1}' -H "Content-type: application/json" + curl -X POST {{ request.url_root }}diagonalley/api/v1/diagonalley/stall/order/<indexer_id> -d '{"id": <product_id&>, "email": <customer_email>, "address": <customer_address>, "quantity": 2, "shippingzone": 1}' -H "Content-type: application/json" @@ -57,7 +57,7 @@
Returns 200 OK (application/json)
{"shipped": <boolean>}
Curl example
- curl -X GET http://127.0.0.1:5000/diagonalley/api/v1/diagonalley/stall/checkshipped/<checking_id> -H "Content-type: application/json" + curl -X GET {{ request.url_root }}diagonalley/api/v1/diagonalley/stall/checkshipped/<checking_id> -H "Content-type: application/json" diff --git a/lnbits/extensions/tpos/templates/tpos/_api_docs.html b/lnbits/extensions/tpos/templates/tpos/_api_docs.html index f4859e2..c43c0fa 100644 --- a/lnbits/extensions/tpos/templates/tpos/_api_docs.html +++ b/lnbits/extensions/tpos/templates/tpos/_api_docs.html @@ -14,7 +14,7 @@
Returns 201 CREATED (application/json)
{"currency": <string>, "id": <string>, "name": <string>, "wallet": <string>}
Curl example
- curl -X GET http://127.0.0.1:5000/tpos/api/v1/tposs -H "X-Api-Key: <invoice_key>" + curl -X GET {{ request.url_root }}tpos/api/v1/tposs -H "X-Api-Key: <invoice_key>" @@ -29,7 +29,7 @@
Returns 201 CREATED (application/json)
{"currency": <string>, "id": <string>, "name": <string>, "wallet": <string>}
Curl example
- curl -X POST http://127.0.0.1:5000/tpos/api/v1/tposs -d '{"name": <string>, "currency": <string>}' -H "Content-type: application/json" -H "X-Api-Key: <admin_key>" + curl -X POST {{ request.url_root }}tpos/api/v1/tposs -d '{"name": <string>, "currency": <string>}' -H "Content-type: application/json" -H "X-Api-Key: <admin_key>" @@ -44,7 +44,7 @@
Returns 201 NO_CONTENT
Curl example
- curl -X DELETE http://127.0.0.1:5000/tpos/api/v1/tposs/<tpos_id> -H "X-Api-Key: <admin_key>" + curl -X DELETE {{ request.url_root }}tpos/api/v1/tposs/<tpos_id> -H "X-Api-Key: <admin_key>" diff --git a/lnbits/extensions/withdraw/templates/withdraw/_api_docs.html b/lnbits/extensions/withdraw/templates/withdraw/_api_docs.html index 85347dc..d60dea9 100644 --- a/lnbits/extensions/withdraw/templates/withdraw/_api_docs.html +++ b/lnbits/extensions/withdraw/templates/withdraw/_api_docs.html @@ -14,7 +14,7 @@
Returns 201 CREATED (application/json)
{"lnurl": <string>}
Curl example
- curl -X GET http://127.0.0.1:5000/withdraw/api/v1/links -H "X-Api-Key: <invoice_key>" + curl -X GET {{ request.url_root }}withdraw/api/v1/links -H "X-Api-Key: <invoice_key>" @@ -29,7 +29,7 @@
Returns 201 CREATED (application/json)
{"lnurl": <string>}
Curl example
- curl -X POST http://127.0.0.1:5000/withdraw/api/v1/links -d '{"title": <string>, "min_withdrawable": <integer>, "max_withdrawable": <integer>, "uses": <integer>, "wait_time": <integer>, "is_unique": <boolean>}' -H "Content-type: application/json" -H "X-Api-Key: <admin_key>" + curl -X POST {{ request.url_root }}withdraw/api/v1/links -d '{"title": <string>, "min_withdrawable": <integer>, "max_withdrawable": <integer>, "uses": <integer>, "wait_time": <integer>, "is_unique": <boolean>}' -H "Content-type: application/json" -H "X-Api-Key: <admin_key>" @@ -45,7 +45,7 @@
Returns 201 CREATED (application/json)
{"lnurl": <string>}
Curl example
- curl -X PUT http://127.0.0.1:5000/withdraw/api/v1/links/<withdraw_id> -d '{"title": <string>, "min_withdrawable": <integer>, "max_withdrawable": <integer>, "uses": <integer>, "wait_time": <integer>, "is_unique": <boolean>}' -H "Content-type: application/json" -H "X-Api-Key: <admin_key>" + curl -X PUT {{ request.url_root }}withdraw/api/v1/links/<withdraw_id> -d '{"title": <string>, "min_withdrawable": <integer>, "max_withdrawable": <integer>, "uses": <integer>, "wait_time": <integer>, "is_unique": <boolean>}' -H "Content-type: application/json" -H "X-Api-Key: <admin_key>" @@ -59,7 +59,7 @@
Returns 201 NO_CONTENT
{"lnurl": <string>}
Curl example
- curl -X DELETE http://127.0.0.1:5000/withdraw/api/v1/links/<withdraw_id> -H "X-Api-Key: <admin_key>" + curl -X DELETE {{ request.url_root }}withdraw/api/v1/links/<withdraw_id> -H "X-Api-Key: <admin_key>"