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.
23 lines
507 B
Python
23 lines
507 B
Python
from flask import Flask
|
|
from flask import request
|
|
import json
|
|
|
|
app = Flask(__name__)
|
|
|
|
import xxx
|
|
|
|
@app.route("/", methods=['GET', 'POST'])
|
|
def index():
|
|
if request.method == 'POST':
|
|
if request.data:
|
|
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='0.0.0.0', port='1234')
|