# coding: utf-8

from flask import Flask
from datetime import timedelta
from config import load_config
from .views.panel import panel
from .views.dashboard import dashboard_bp
from .views.integration import integration
from .views.settings import settings
from .views.account import accounts_bp
from os.path import dirname
import bugsnag
from bugsnag.flask import handle_exceptions

bugsnag.configure(
    api_key="A0Zr98j/3yX R~XHH!jmN]LWX/,?RT",
    project_root=dirname(dirname(__file__)),
)


def make_app():
    app = Flask(__name__)
    config = load_config()
    handle_exceptions(app)
    app.config.from_object(config)
    app.permanent_session_lifetime = timedelta(hours=1)
    register_routes(app, panel, dashboard_bp, integration, settings, accounts_bp)
    return app


def register_routes(app, *route_list):
    for route in route_list:
        app.register_blueprint(route)

@@ -127,16 +127,51 @@
 t panel%0A
+from .views.restapi import restapi%0A
 from .vi
@@ -743,16 +743,25 @@
 , panel,
+ restapi,
  dashboa
@@ -766,16 +766,36 @@
 oard_bp,
+%0A                   
  integra

correct location map