Skip to content

Commit

Permalink
Add: app insights
Browse files Browse the repository at this point in the history
  • Loading branch information
alguadam committed Oct 1, 2023
1 parent f880be3 commit e64ce9d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions iebank_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from flask_cors import CORS
from dotenv import load_dotenv
import os
from applicationinsights.flask.ext import AppInsights

app = Flask(__name__)

Expand Down Expand Up @@ -31,3 +32,11 @@
CORS(app)

from iebank_api import routes

# Initialize Application Insights and force flushing application insights handler after each request
if('ENV' != 'ghci'):
appinsights = AppInsights(app)
@app.after_request
def after_request(response):
appinsights.flush()
return response

0 comments on commit e64ce9d

Please sign in to comment.