19 lines
495 B
Python
19 lines
495 B
Python
from flask import Flask, render_template, jsonify
|
|
from routes.conditions import create_conditions_routes
|
|
from db import get_connection, getRethinkDB
|
|
|
|
app = Flask(__name__)
|
|
r = getRethinkDB()
|
|
|
|
create_conditions_routes(app)
|
|
|
|
@app.route('/')
|
|
def index():
|
|
cursor = r.table("conditions").run(get_connection())
|
|
conditions = list(cursor)
|
|
return render_template('index.html', data={"conditions": conditions })
|
|
|
|
if __name__ == '__main__':
|
|
app.run(host='0.0.0.0', port=8080, debug=True)
|
|
|