Add modules: api, operations, routes with org display
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
from flask import Blueprint, current_app, render_template
|
||||
|
||||
from api.http_client import HttpClient
|
||||
from operations.get_instances import get_organization
|
||||
|
||||
bp = Blueprint("main", __name__)
|
||||
|
||||
|
||||
@bp.route("/")
|
||||
def index():
|
||||
org = None
|
||||
error = None
|
||||
try:
|
||||
client = HttpClient(
|
||||
current_app.config["NUBES_API_ENDPOINT"],
|
||||
current_app.config["NUBES_API_TOKEN"],
|
||||
)
|
||||
org = get_organization(client)
|
||||
except Exception as e:
|
||||
error = str(e)
|
||||
return render_template("index.html", organization=org, error=error)
|
||||
Reference in New Issue
Block a user