Skip to content

Instantly share code, notes, and snippets.

@nderkach
Created December 4, 2017 18:24
Show Gist options
  • Select an option

  • Save nderkach/79464b165065df51f99dbc4f3442c614 to your computer and use it in GitHub Desktop.

Select an option

Save nderkach/79464b165065df51f99dbc4f3442c614 to your computer and use it in GitHub Desktop.
@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