-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
executable file
·39 lines (32 loc) · 1 KB
/
app.py
File metadata and controls
executable file
·39 lines (32 loc) · 1 KB
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
from flask import Flask, render_template, request, jsonify
from diagonal_controller import DiagonalController
app = Flask(__name__)
@app.route("/")
def index():
return render_template("index.html")
@app.route("/square", methods=['GET', 'POST'])
def getsquare():
if request.method == 'GET':
return render_template("square.html")
else:
return DiagonalController.getSquare(request)
@app.route("/circle", methods=['GET', 'POST'])
def getcircle():
if request.method == 'POST':
return DiagonalController.getCircle(request)
else:
return render_template("circle.html")
@app.route("/rectangle", methods=['GET', 'POST'])
def getrectangle():
if request.method == 'POST':
return DiagonalController.getRectangle(request)
else:
return render_template("rectangle.html")
@app.route("/triangle", methods=['GET', 'POST'])
def gettriangle():
if request.method == 'POST':
return DiagonalController.getTriangle(request)
else:
return render_template("triangle.html")
if __name__ == '__main__':
app.run(debug=True)