Entfernt: redundanter /monitor-Endpunkt, da /api/monitor identische Funktion bietet
This commit is contained in:
19
app.py
19
app.py
@@ -169,25 +169,6 @@ def stats():
|
||||
api_counts[api] = api_counts.get(api, 0) + 1
|
||||
return render_template('stats_dashboard.html', pageviews=pageviews, func_counts=func_counts, impressions_per_day=impressions_per_day, api_counts=api_counts)
|
||||
|
||||
|
||||
@app.route('/monitor')
|
||||
def monitor():
|
||||
log_path = os.path.join('log', 'pageviews.log')
|
||||
pageviews = 0
|
||||
if os.path.exists(log_path):
|
||||
with open(log_path, encoding='utf-8') as f:
|
||||
for line in f:
|
||||
if 'PAGEVIEW' in line:
|
||||
pageviews += 1
|
||||
uptime = int(time.time() - app_start_time)
|
||||
return jsonify({
|
||||
"status": "ok",
|
||||
"message": "App running",
|
||||
"time": datetime.now().isoformat(),
|
||||
"uptime_seconds": uptime,
|
||||
"pageviews_last_7_days": pageviews
|
||||
})
|
||||
|
||||
# --- REST API ---
|
||||
def log_api_usage(api_name):
|
||||
log_dir = 'log'
|
||||
|
Reference in New Issue
Block a user