29 lines
770 B
Python
29 lines
770 B
Python
from flask import Blueprint, render_template, request
|
|
from jinja2 import TemplateNotFound
|
|
|
|
blueprint = Blueprint(
|
|
'vue3_neusik',
|
|
__name__,
|
|
static_folder='static',
|
|
static_url_path='/static',
|
|
template_folder='templates',
|
|
)
|
|
|
|
@blueprint.route('/', methods=['GET'])
|
|
def index():
|
|
return render_template(
|
|
'vue3_neusik/index.html',
|
|
import_on_load='true' if request.args.get('import') == '1' else 'false',
|
|
)
|
|
|
|
@blueprint.route('/audiowidget', methods=['GET'])
|
|
def audiowidget():
|
|
try:
|
|
return render_template(
|
|
'vue3_neusik/audiowidget.tmpl',
|
|
result_url=request.args.get('result_url', ''),
|
|
errors=request.args.get('errors', ''),
|
|
)
|
|
except TemplateNotFound:
|
|
return '', 204
|