changeset 4248:f3fbfde9683d

mod_rest/example: Reorder things to match the disco#info feature order Satisfies my OCD!
author Kim Alvefur <zash@zash.se>
date Sun, 15 Nov 2020 15:41:52 +0100
parents 1f93fa24611d
children 64aa1d9d70ac
files mod_rest/example/app.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mod_rest/example/app.py	Sun Nov 15 15:33:56 2020 +0100
+++ b/mod_rest/example/app.py	Sun Nov 15 15:41:52 2020 +0100
@@ -31,11 +31,7 @@
             return jsonify({"body": "Yes this is flask app"})
 
         elif data["kind"] == "iq" and data["type"] == "get":
-            if "ping" in data:
-                # Respond to ping
-                return Response(status=204)
-
-            elif "disco" in data:
+            if "disco" in data:
                 # Return supported features
                 return jsonify(
                     {
@@ -67,6 +63,10 @@
                 # Version info
                 return jsonify({"version": {"name": "app.py", "version": "0"}})
 
+            elif "ping" in data:
+                # Respond to ping
+                return Response(status=204)
+
     return Response(status=501)