2.0.0 Beta : Self-hosted Release
This commit is contained in:
@@ -1,8 +1,28 @@
|
||||
from flask import Blueprint, render_template, request, jsonify
|
||||
from web.database import query_db
|
||||
from web.config import Config
|
||||
from web.services.stats_service import StatsService
|
||||
|
||||
bp = Blueprint('main', __name__)
|
||||
|
||||
|
||||
@bp.route('/healthz')
|
||||
def healthz():
|
||||
try:
|
||||
for db_name in ('l2', 'l3', 'web'):
|
||||
query_db(db_name, 'SELECT 1', one=True)
|
||||
except Exception as exc:
|
||||
return jsonify({
|
||||
'status': 'unhealthy',
|
||||
'error': str(exc),
|
||||
'brand': Config.BRAND_PRIMARY,
|
||||
}), 503
|
||||
return jsonify({
|
||||
'status': 'ok',
|
||||
'version': '2.0.0-beta',
|
||||
'brand': Config.BRAND_PRIMARY,
|
||||
})
|
||||
|
||||
@bp.route('/')
|
||||
def index():
|
||||
recent_matches = StatsService.get_recent_matches(limit=5)
|
||||
|
||||
Reference in New Issue
Block a user