finfree-be/app.py

22 lines
586 B
Python

from flask import Flask, render_template, jsonify
from routes.conditions import create_conditions_routes
from db import get_connection, getRethinkDB
from routes.create import create_routes
from models.Abc import Abc
app = Flask(__name__)
r = getRethinkDB()
create_conditions_routes(app)
create_routes(Abc, 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)