Skip to content

Instantly share code, notes, and snippets.

@JulianSauer
Created October 23, 2021 14:38
Show Gist options
  • Save JulianSauer/e9b962b5310010b4c2e7d677641b0518 to your computer and use it in GitHub Desktop.
Save JulianSauer/e9b962b5310010b4c2e7d677641b0518 to your computer and use it in GitHub Desktop.
from flask import Flask, request
api = Flask(__name__)
@api.route('/greet', methods=['GET'])
def greet():
name = request.args.get('name')
if name is None:
return "Hi!"
return "Hi " + name + "!"
if __name__ == '__main__':
api.run(port=5000, host='0.0.0.0')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment