Last active
October 19, 2019 03:40
-
-
Save bjyurkovich/314249052713f5df1559d79235d1ce17 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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