Mercurial > prosody-modules
comparison mod_rest/example/app.py @ 3854:25c34c9f755c
mod_rest: Add mapping of XEP-0092: Software Version
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 25 Jan 2020 00:40:38 +0100 |
| parents | fb29d7cd698b |
| children | ede3d1724dd1 |
comparison
equal
deleted
inserted
replaced
| 3853:fb29d7cd698b | 3854:25c34c9f755c |
|---|---|
| 42 elif "items" in data: | 42 elif "items" in data: |
| 43 return jsonify( | 43 return jsonify( |
| 44 {"items": [{"jid": "example.org", "name": "Example Dot Org"}]} | 44 {"items": [{"jid": "example.org", "name": "Example Dot Org"}]} |
| 45 ) | 45 ) |
| 46 | 46 |
| 47 elif "version" in data: | |
| 48 return jsonify({"version": {"name": "app.py", "version": "0"}}) | |
| 49 | |
| 47 return Response(status=501) | 50 return Response(status=501) |
| 48 | 51 |
| 49 | 52 |
| 50 if __name__ == "__main__": | 53 if __name__ == "__main__": |
| 51 app.run() | 54 app.run() |
