Spaces:
Sleeping
Sleeping
File size: 530 Bytes
e45eccd f1d7d4d 596475f f1d7d4d 596475f e45eccd f1d7d4d 596475f f1d7d4d e45eccd 596475f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
from flask import Flask, jsonify, render_template, request
app = Flask(__name__)
@app.route('/')
def home():
return render_template('index.html')
@app.route('/health')
def health():
return jsonify({"status": "ok"})
@app.route('/action1', methods=['POST'])
def action1():
return jsonify({"result": "You clicked Button 1!"})
@app.route('/action2', methods=['POST'])
def action2():
return jsonify({"result": "You clicked Button 2!"})
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000, debug=True) |