mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-25 07:07:48 +01:00
28 lines
No EOL
699 B
Python
28 lines
No EOL
699 B
Python
from quart import g, render_template
|
|
|
|
from lnbits.decorators import check_user_exists, validate_uuids
|
|
|
|
from pyngrok import conf, ngrok
|
|
from . import ngrok_ext
|
|
|
|
|
|
def log_event_callback(log):
|
|
string = str(log)
|
|
string2 = string[string.find('url="https') : string.find('url="https') + 40]
|
|
if string2:
|
|
string3 = string2
|
|
string4 = string3[4:]
|
|
global string5
|
|
string5 = string4.replace('"', "")
|
|
|
|
|
|
conf.get_default().log_event_callback = log_event_callback
|
|
|
|
ngrok_tunnel = ngrok.connect(5000)
|
|
|
|
|
|
@ngrok_ext.route("/")
|
|
@validate_uuids(["usr"], required=True)
|
|
@check_user_exists()
|
|
async def index():
|
|
return await render_template("ngrok/index.html", ngrok=string5) |