mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-25 15:10:41 +01:00
26 lines
730 B
Python
26 lines
730 B
Python
# views_api.py is for you API endpoints that could be hit by another service
|
|
|
|
# add your dependencies here
|
|
|
|
# import json
|
|
# import requests
|
|
|
|
from flask import jsonify
|
|
from http import HTTPStatus
|
|
|
|
from lnbits.extensions.example import example_ext
|
|
|
|
|
|
# add your endpoints here
|
|
|
|
|
|
@example_ext.route("/api/v1/tools", methods=["GET"])
|
|
def api_example():
|
|
"""Try to add descriptions for others."""
|
|
tools = [
|
|
{"name": "Flask", "url": "https://flask.palletsprojects.com/", "language": "Python",},
|
|
{"name": "Vue.js", "url": "https://vuejs.org/", "language": "JavaScript",},
|
|
{"name": "Quasar Framework", "url": "https://quasar.dev/", "language": "JavaScript",},
|
|
]
|
|
|
|
return jsonify(tools), HTTPStatus.OK
|