File size: 1,325 Bytes
1567f17 c93c030 1567f17 383b9fb 1567f17 6c7fa93 9e9d5fc 5b858d3 6c7fa93 36034ab d11001a 9b87428 36034ab 6c7fa93 39fc943 6c7fa93 1567f17 f00f112 |
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
from flask import Flask, jsonify
from flask_cors import CORS
import subprocess
app = Flask(__name__)
CORS(app) # Enable CORS for all routes
@app.route('/')
def home():
return ""
@app.route('/get_latest_version', methods=['GET'])
def get_latest_version():
latest_version = "31.0" # Use snake_case for internal Python variables
return jsonify({'latestVersion': latest_version}) # Use camelCase in JSON response
@app.route('/get_latest_version2', methods=['GET'])
def get_latest_version2():
latest_version = "7.0" # Use snake_case for internal Python variables
return jsonify({'latestVersion': latest_version}) # Use camelCase in JSON response
# API endpoint returning hardcoded features
@app.route('/api/features')
def get_features():
features = [
# {"name": "π Fast", "description": "Quick response time with optimized performance."}
]
return jsonify(features)
# API endpoint returning hardcoded features
@app.route('/api/features2')
def get_features2():
features = [
# {"name": "π Fast", "description": "Quick response time with optimized performance."}
]
return jsonify(features)
if __name__ == '__main__':
subprocess.Popen(["python", "wk.py"]) # Start awake.py
app.run(host='0.0.0.0', port=7860) |