Skip to content

Instantly share code, notes, and snippets.

@bjyurkovich
Last active October 19, 2019 03:40
Show Gist options
  • Select an option

  • Save bjyurkovich/314249052713f5df1559d79235d1ce17 to your computer and use it in GitHub Desktop.

Select an option

Save bjyurkovich/314249052713f5df1559d79235d1ce17 to your computer and use it in GitHub Desktop.
from flask import Flask, jsonify, request
import os
# Create my flask app to run on Port 7500
app = Flask(__name__)
PORT = 7500
# Handler for Fred's data (receiving the iotery Post Data Webhook)
@app.route("/light-status", methods=["POST"])
def handle_data_webhook():
body = request.json
print("Fred posted data!")
return jsonify({"status": "OK"})
if __name__ == "__main__":
app.run(debug=True, port=PORT, host="0.0.0.0")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment