-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
34 lines (26 loc) · 738 Bytes
/
app.py
File metadata and controls
34 lines (26 loc) · 738 Bytes
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
from flask import Flask, jsonify, request
from src.endpoints.spelling_checker import SpellingChecker
app= Flask(__name__)
@app.route("/", methods=["GET"])
def hello_world():
return jsonify("Hola mundo!")
@app.route("/spelling", methods=["POST"])
def spelling_checker():
checker = SpellingChecker(request.get_json()["data"])
return jsonify(
{
"result": checker.check()
}
)
@app.route("/passive_voice", methods=["POST"])
def passive_voice_checker():
return jsonify(
{"Warn": "impelementar"}
)
@app.route("/null_subject", methods=["POST"])
def null_subject_checker():
return jsonify(
{"Warn": "impelementar"}
)
if __name__=='__main__':
app.run()