mirror of
https://github.com/asimonson1125/asimonson1125.github.io.git
synced 2026-02-25 13:09:51 -06:00
sample status page
This commit is contained in:
@@ -3,9 +3,13 @@ from flask_minify import Minify
|
||||
import json
|
||||
import werkzeug.exceptions as HTTPerror
|
||||
from config import *
|
||||
from monitor import monitor
|
||||
|
||||
app = flask.Flask(__name__)
|
||||
|
||||
# Start service monitoring
|
||||
monitor.start_monitoring()
|
||||
|
||||
# Add security and caching headers
|
||||
@app.after_request
|
||||
def add_security_headers(response):
|
||||
@@ -40,6 +44,11 @@ pages['projects']['projects'] = proj
|
||||
pages['home']['books'] = books
|
||||
pages['books']['books'] = books
|
||||
|
||||
@app.route('/api/status')
|
||||
def api_status():
|
||||
"""API endpoint for service status"""
|
||||
return flask.jsonify(monitor.get_status_summary())
|
||||
|
||||
@app.route('/api/goto/')
|
||||
@app.route('/api/goto/<location>')
|
||||
def goto(location='home'):
|
||||
|
||||
Reference in New Issue
Block a user