File size: 711 Bytes
c038eac
 
ec34ee8
c038eac
 
 
ec34ee8
 
 
 
 
c038eac
 
ec34ee8
 
 
 
 
c038eac
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from flask import Flask, render_template, send_from_directory
import os
import logging

app = Flask(__name__)

# Change Jinja2 delimiters to avoid conflict with Vue.js
# Vue uses {{ }}, so we change Flask/Jinja2 to use [[ ]]
app.jinja_env.variable_start_string = '[['
app.jinja_env.variable_end_string = ']]'

@app.route('/')
def index():
    try:
        return render_template('index.html')
    except Exception as e:
        app.logger.error(f"Error rendering template: {str(e)}")
        return f"Internal Server Error: {str(e)}", 500

@app.route('/static/<path:path>')
def send_static(path):
    return send_from_directory('static', path)

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=7860)