Skip to content

Commit

Permalink
try logging reqquest behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
CalebCourier committed Feb 27, 2024
1 parent c7e4988 commit 199f0f1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from flask import Flask
from flask import Flask, request, Response
from flask_cors import CORS
from werkzeug.middleware.proxy_fix import ProxyFix
from urllib.parse import urlparse
Expand All @@ -8,6 +8,16 @@

def create_app():
app = Flask(__name__)

@app.before_request
def trace_requests_before():
print(f"Request {request.endpoint} received!")

@app.after_request
def trace_requests_after(response: Response):
print(f"Responding to request with status: {response.status}")
return response

app.config["PREFERRED_URL_SCHEME"] = "https"
CORS(app)

Expand Down

0 comments on commit 199f0f1

Please sign in to comment.