def post_login(): """ Attempts login of the user POST /priv/login Data: { "username": "******", "password": "******" } """ try: payload = json.loads(request.get_data()) username = payload["username"] password = payload["password"] return json_dump({"hello": "from post_login"}) except Exception: print(traceback.format_exc()) return "Error", 500
def get_message(idx): try: return json_dump({"hello": "from get_message"}) except Exception: print(traceback.format_exc()) return "Error", 500
def get_user(idx): users = Table("users", metadata, autoload=True) r = users.select(users.c.User_ID == idx).execute().first() return json_dump(dict(r))