You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
465 B
Python

from flask import Flask, request, abort
import json
app = Flask(__name__)
import xxx
@app.route("/", methods=['GET', 'POST'])
def index():
if request.method != 'POST' or not request.data:
return abort(400);
params = json.loads(request.data.decode(encoding='utf-8'))
pos = params['pos'];
ws = xxx.run(pos);
return {
'pos': pos,
'ws': ws,
}
if __name__ == "__main__":
app.run(host='localhost', port='1234')