| Conditions | 1 |
| Total Lines | 26 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | from flask import Flask, render_template |
||
| 10 | def create_app(): |
||
| 11 | """ |
||
| 12 | Create app |
||
| 13 | """ |
||
| 14 | |||
| 15 | # app initialization |
||
| 16 | app = Flask(__name__) |
||
| 17 | |||
| 18 | # bootstrap initialization |
||
| 19 | bootstrap.init_app(app) |
||
| 20 | all_blueprints = [*api_blueprints, bot_routes] |
||
| 21 | # register all blueprints |
||
| 22 | _ = [ |
||
| 23 | app.register_blueprint(bp.get("blueprint"), url_prefix=bp.get("url_prefix")) |
||
| 24 | for bp in all_blueprints |
||
| 25 | ] |
||
| 26 | |||
| 27 | @app.route("/", methods=["GET"]) |
||
| 28 | @app.route("/index") |
||
| 29 | def index(): |
||
| 30 | """ |
||
| 31 | example endpoint |
||
| 32 | """ |
||
| 33 | return render_template("index.html") |
||
| 34 | |||
| 35 | return app |
||
| 36 |