docs: миграция на tgFlaskForm и производительность Flask; контур flask_app; UI без лишних описаний
Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import os
|
||||
import secrets
|
||||
|
||||
from flask import Flask, jsonify
|
||||
|
||||
|
||||
def create_app() -> Flask:
|
||||
app = Flask(
|
||||
__name__,
|
||||
instance_relative_config=True,
|
||||
template_folder='templates',
|
||||
static_folder='static',
|
||||
static_url_path='/static',
|
||||
)
|
||||
sk = (os.environ.get('SECRET_KEY') or '').strip()
|
||||
app.config['SECRET_KEY'] = sk or secrets.token_hex(32)
|
||||
|
||||
@app.route('/health')
|
||||
def health():
|
||||
return jsonify(status='ok', service='testing-flask-app')
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
from flask import render_template
|
||||
|
||||
return render_template('index.html')
|
||||
|
||||
return app
|
||||
@@ -0,0 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Тестирование</title>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user