Skip to content

Instantly share code, notes, and snippets.

@elseagle
Last active May 25, 2019 03:29
Show Gist options
  • Save elseagle/8e3431564c309d184c240598e46fcd70 to your computer and use it in GitHub Desktop.
Save elseagle/8e3431564c309d184c240598e46fcd70 to your computer and use it in GitHub Desktop.
@app.route('/item/<string:name>')
def get(name):
item = find_by_name(name)
if item:
return item
return jsonify({'message': 'Item not found'}), 404
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment