File size: 576 Bytes
56266ec
 
3333658
53ac83e
22ad7f3
 
53ac83e
22ad7f3
 
 
9a5dd56
 
4de9537
 
 
 
bf59c35
9a5dd56
56266ec
 
 
 
 
 
3333658
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
25
26
from flask import Flask, request
from app import judge
from train.add_data import add
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"])
def check():
    comment = request.json['comment']
    result = judge(comment)
    add(comment, result[0], result[1], result[2], result[3], result[4], result[5])
    return result