entire app update:
moder view app with static page, forgejo ci/cd workflow
This commit is contained in:
parent
25c896f809
commit
e6e700c2ee
13 changed files with 460 additions and 28 deletions
27
app/routes.py
Normal file
27
app/routes.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
from flask import Blueprint, render_template, jsonify
|
||||
import os
|
||||
import datetime
|
||||
|
||||
main = Blueprint('main', __name__)
|
||||
|
||||
@main.route('/')
|
||||
def index():
|
||||
return render_template('index.html',
|
||||
title='Flask CI/CD Demo',
|
||||
version=os.environ.get('APP_VERSION', '1.0.0'))
|
||||
|
||||
@main.route('/health')
|
||||
def health():
|
||||
return jsonify({
|
||||
'status': 'healthy',
|
||||
'timestamp': datetime.datetime.now().isoformat(),
|
||||
'environment': os.environ.get('FLASK_ENV', 'production')
|
||||
})
|
||||
|
||||
@main.route('/api/info')
|
||||
def info():
|
||||
return jsonify({
|
||||
'app': 'Flask CI/CD Demo',
|
||||
'version': os.environ.get('APP_VERSION', '1.0.0'),
|
||||
'commit': os.environ.get('COMMIT_HASH', 'unknown')
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue