threaded=True
Browse files
main.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
from flask import Flask, request
|
2 |
from app import judge
|
3 |
from flask_cors import CORS
|
|
|
4 |
|
5 |
app = Flask(__name__)
|
6 |
CORS(app)
|
@@ -18,7 +19,11 @@ def returnText(text):
|
|
18 |
return f'The text is {text}'
|
19 |
|
20 |
@app.route("/check", methods=["POST"])
|
21 |
-
|
22 |
comment = request.json['comment']
|
23 |
result = judge(comment)
|
24 |
-
return result
|
|
|
|
|
|
|
|
|
|
1 |
from flask import Flask, request
|
2 |
from app import judge
|
3 |
from flask_cors import CORS
|
4 |
+
import threading
|
5 |
|
6 |
app = Flask(__name__)
|
7 |
CORS(app)
|
|
|
19 |
return f'The text is {text}'
|
20 |
|
21 |
@app.route("/check", methods=["POST"])
|
22 |
+
def check():
|
23 |
comment = request.json['comment']
|
24 |
result = judge(comment)
|
25 |
+
return result
|
26 |
+
|
27 |
+
if __name__ == '__main__':
|
28 |
+
|
29 |
+
app.run(debug=False, threaded=True)
|