k_main.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # -*- coding: utf-8 -*- import os import k_process from flask import Flask, request, jsonify app = Flask(__name__) @app.route('/keyboard') def Keyboard(): res = k_process.buttons() return jsonify(res) @app.route('/message', methods=['POST']) def Message(): data = request.get_json() return jsonify(k_process.response(data['content'])) if __name__ == "__main__": app.run(host='0.0.0.0', port=80) | cs |