Created
December 4, 2017 18:24
-
-
Save nderkach/79464b165065df51f99dbc4f3442c614 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @app.route('/users/<string:user_id>') | |
| def users(user_id): | |
| profile = firebase.get('/users/{}'.format(user_id), "public") | |
| return jsonify(profile) | |
| @app.route('/users') | |
| def users_by_email(): | |
| # TODO: single network call | |
| email = request.args.get("email") | |
| if email: | |
| r = requests.get(CLOUD_URL + "/user_by_email", params={"email": email}) | |
| if r.status_code != 200: | |
| abort(404) | |
| user_id = r.text | |
| profile = firebase.get('/users/{}'.format(user_id), "public") | |
| return jsonify(profile) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment