File size: 474 Bytes
56266ec
 
53ac83e
22ad7f3
 
53ac83e
22ad7f3
 
 
9a5dd56
 
4de9537
 
 
 
bf59c35
9a5dd56
56266ec
 
 
9698e15
56266ec
9698e15
56266ec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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