Skip to content

Instantly share code, notes, and snippets.

@amalgjose
Last active February 5, 2023 02:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save amalgjose/aca9d165d30214943e20e367cb9ab56e to your computer and use it in GitHub Desktop.
Save amalgjose/aca9d165d30214943e20e367cb9ab56e to your computer and use it in GitHub Desktop.
Sample python flask web service (RESTful service). This has only one endpoint (GET)
import json
from flask import Flask
app = Flask(__name__)
@app.route("/requestme", methods = ["GET"])
def hello():
response = {"message":"Hello Flask.!!"}
return json.dumps(response)
if __name__ == '__main__':
app.run(host="0.0.0.0", port=9090, debug=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment