File size: 444 Bytes
56262e9
 
b7c8d06
56262e9
b7c8d06
56262e9
 
 
 
b7c8d06
56262e9
 
 
 
 
b7c8d06
56262e9
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from flask import Flask, render_template, request, jsonify
import os

app = Flask(__name__)

# Home route
@app.route('/')
def home():
    return render_template('index.html')

# API example
@app.route('/api/hello', methods=['GET'])
def hello():
    name = request.args.get('name', 'World')
    return jsonify({'message': f'Hello {name}!'})

# For Hugging Face Spaces
if __name__ == '__main__':
    app.run(debug=True, host='0.0.0.0', port=7860)