Added meta for api /docs

This commit is contained in:
ben 2022-07-27 18:20:36 +01:00
parent 22592d6fde
commit 58659d2f47
3 changed files with 24 additions and 12 deletions

View file

@ -45,7 +45,14 @@ def create_app(config_object="lnbits.settings") -> FastAPI:
""" """
configure_logger() configure_logger()
app = FastAPI() app = FastAPI(
title="LNbits API",
description="API for LNbits, the free and open source bitcoin wallet and accounts system with plugins.",
license_info={
"name": "MIT License",
"url": "https://raw.githubusercontent.com/lnbits/lnbits-legend/main/LICENSE",
},
)
app.mount("/static", StaticFiles(packages=[("lnbits", "static")]), name="static") app.mount("/static", StaticFiles(packages=[("lnbits", "static")]), name="static")
app.mount( app.mount(
"/core/static", "/core/static",

View file

@ -135,9 +135,7 @@
var self = this var self = this
axios axios
.get( .get('/events/api/v1/tickets/' + '{{ event_id }}')
'/events/api/v1/tickets/' + '{{ event_id }}'
)
.then(function (response) { .then(function (response) {
self.paymentReq = response.data.payment_request self.paymentReq = response.data.payment_request
self.paymentCheck = response.data.payment_hash self.paymentCheck = response.data.payment_hash
@ -155,13 +153,17 @@
paymentChecker = setInterval(function () { paymentChecker = setInterval(function () {
axios axios
.post('/events/api/v1/tickets/' + '{{ event_id }}/' + self.paymentCheck, .post(
'/events/api/v1/tickets/' +
'{{ event_id }}/' +
self.paymentCheck,
{ {
event: '{{ event_id }}', event: '{{ event_id }}',
event_name: '{{ event_name }}', event_name: '{{ event_name }}',
name: self.formDialog.data.name, name: self.formDialog.data.name,
email: self.formDialog.data.email email: self.formDialog.data.email
}) }
)
.then(function (res) { .then(function (res) {
if (res.data.paid) { if (res.data.paid) {
clearInterval(paymentChecker) clearInterval(paymentChecker)

View file

@ -133,7 +133,10 @@
var self = this var self = this
LNbits.api LNbits.api
.request('GET', '/events/api/v1/register/ticket/' + res.split("//")[1]) .request(
'GET',
'/events/api/v1/register/ticket/' + res.split('//')[1]
)
.then(function (response) { .then(function (response) {
self.$q.notify({ self.$q.notify({
type: 'positive', type: 'positive',