Diff

mod_rest/example/app.py @ 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
parent 4246:53ae1df31950
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)