From a977c4bd1f7d2f60494a8b683987680fd5624d4a Mon Sep 17 00:00:00 2001 From: Graham Haworth Date: Thu, 7 Aug 2014 18:31:23 -0500 Subject: [PATCH 1/3] Set to run in debug mode --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index ba56ec1..9e213a4 100755 --- a/main.py +++ b/main.py @@ -3,4 +3,4 @@ from example import app if __name__ == '__main__': - app.run() + app.run(debug=True) From d7723fa9ba5b5b1d41886bd7b536751b5e067a93 Mon Sep 17 00:00:00 2001 From: Graham Haworth Date: Thu, 7 Aug 2014 18:32:15 -0500 Subject: [PATCH 2/3] Added another endpoint to get the current time --- example/app.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/example/app.py b/example/app.py index 77dd28a..9358bdd 100644 --- a/example/app.py +++ b/example/app.py @@ -1,6 +1,7 @@ from example import app from time import sleep +import datetime @app.route('/process') def process(): @@ -9,3 +10,10 @@ def process(): """ sleep(3) return 'Processing Complete!' + +@app.route('/time') +def time(): + """ + Gets the current time. + """ + return datetime.time() From af1354fd806531c695023f09cb5a0d691a74cc30 Mon Sep 17 00:00:00 2001 From: Graham Haworth Date: Thu, 7 Aug 2014 18:42:12 -0500 Subject: [PATCH 3/3] Fixed improper implementation of /time endpoint --- example/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/app.py b/example/app.py index 9358bdd..390ce1a 100644 --- a/example/app.py +++ b/example/app.py @@ -1,7 +1,7 @@ from example import app from time import sleep -import datetime +from datetime import datetime @app.route('/process') def process(): @@ -16,4 +16,4 @@ def time(): """ Gets the current time. """ - return datetime.time() + return datetime.now().strftime('%d/%m/%y %H:%M')