toxic / main.py
HMPhuoc's picture
add assync
9698e15
raw
history blame
No virus
474 Bytes
from flask import Flask, request
from app import judge
from flask_cors import CORS
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"])
async def check():
comment = request.json['comment']
result = await judge(comment)
return result