Spaces:
Running
Running
File size: 872 Bytes
56266ec 880e759 53ac83e 3ff429e 22ad7f3 53ac83e 22ad7f3 9a5dd56 4de9537 bf59c35 9a5dd56 56266ec 3ff429e 56266ec 2732528 3ff429e 3f656fb 6844ad4 3f656fb 880e759 3ff429e f97ddf1 |
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 |
from flask import Flask, request
from app import judge, judgePlus, judgeBert
from flask_cors import CORS
import threading
app = Flask(__name__)
CORS(app)
@app.route("/")
def hello():
return {"hello":"Deploy success"}
@app.route("/test")
def test():
return "Test success"
@app.route("/test/<text>")
def returnText(text):
return f'The text is {text}'
@app.route("/check", methods=["POST"])
def check():
comment = request.json['comment']
result = judge(comment)
return result
@app.route("/checkplus", methods=["POST"])
def checkPlus():
comment = request.json['comment']
result = judgePlus(comment)
return result
@app.route("/checkbert", methods=["POST"])
def checkBert():
comment = request.json['comment']
result = judgeBert(comment)
return result
if __name__ == '__main__':
app.run(debug=False, threaded=True) |