Distributed and decentralized pi calculation

IT WORKS,

+8 -11
+7 -10
src/server/app.py
··· 19 19 else: 20 20 return "Invaild method! /getpi is designed for GET requests, not " + request.method 21 21 22 - @app.route('/api/postpi') 22 + @app.route('/api/postpi', methods=['POST', 'GET']) 23 23 def postpi(): 24 - if request.method == 'POST': 25 - if request.form['pi']: 26 - if request.form['pi'].startswith("3.14") == True: 27 - with open("picalc/pi.txt", "w") as f: 28 - f.write(request.form['pi']) 29 - else: 30 - return "Invalid string!" 31 - else: 32 - return "Invalid method! /postpi is designed for POST requests, not " + request.method 24 + if request.form['pi']: 25 + if request.form['pi'].startswith("3.14") == True: 26 + with open("picalc/pi.txt", "w") as f: 27 + f.write(request.form['pi']) 28 + else: 29 + return "Invalid string!" 33 30 34 31 @app.route('/') 35 32 def lander():
+1 -1
src/server/picalc/pi.txt
··· 1 - No clients have connected yet. Become one of the first! 1 + 3.1415926535897932384626433832795028841971693993751058209749445924