Skip to content

Instantly share code, notes, and snippets.

@maininformer
Last active April 9, 2018 20:29
Show Gist options
  • Save maininformer/b22e0b23dde175e411e9d4d321c73c67 to your computer and use it in GitHub Desktop.
Save maininformer/b22e0b23dde175e411e9d4d321c73c67 to your computer and use it in GitHub Desktop.
Flask local webhook tester
import json
from flask import Flask, request
app = Flask(__name__)

@app.route("/", methods=["GET", "POST"])
def hello():
    return "Hello World!"

@app.route("/payload", methods=['POST'])
def show_payload():
    print json.dumps(request.json, indent=4)
    return 'Success\n'

if __name__ == "__main__":
    app.run(host='0.0.0.0', port=5001)
./ngrok http 0.0.0.0:5001

It is very important not to add '/' to ngrok like ./ngrok http 0.0.0.0:5001/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment