billing frontend for mariadb. setup as otb_billing for outsidethebox.top accounting. also involved with outsidethedb
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

31 lines
672 B

from flask import Flask
from db import get_db_connection
app = Flask(__name__)
@app.route("/")
def index():
return "OTB Billing v0.0.3 running"
@app.route("/dbtest")
def dbtest():
try:
conn = get_db_connection()
cursor = conn.cursor()
cursor.execute("SELECT NOW()")
result = cursor.fetchone()
conn.close()
return f"""
<h1>Database Connection OK</h1>
<p>Server time: {result[0]}</p>
"""
except Exception as e:
return f"""
<h1>Database Connection FAILED</h1>
<pre>{e}</pre>
"""
if __name__ == "__main__":
app.run(host="0.0.0.0", port=5050)