Skip to content

Instantly share code, notes, and snippets.

@sidmutha
Created October 4, 2017 18:06
Show Gist options
  • Save sidmutha/fdc5c88e9596ce705c54a5ba67f8895f to your computer and use it in GitHub Desktop.
Save sidmutha/fdc5c88e9596ce705c54a5ba67f8895f to your computer and use it in GitHub Desktop.
from src import app
from flask import jsonify, request
@app.route("/")
def hello():
return json.dumps({"message":"Autobots Assemble"})
@app.route("/<process_topic>", methods=['POST'])
def process_url(process_topic):
topic = process_topic[8:] # remove 'process-' and get topic
print("[Topic {}] {}".format(topic, request.json))
return ('', 204)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment