Skip to content

Instantly share code, notes, and snippets.

@hugolhafner
Created August 11, 2017 14:48
Show Gist options
  • Save hugolhafner/ded2d76fbbf8ebddf0989997acb07fc4 to your computer and use it in GitHub Desktop.
Save hugolhafner/ded2d76fbbf8ebddf0989997acb07fc4 to your computer and use it in GitHub Desktop.
@app.route("/add-shopify", methods=["POST"])
def add_shopify():
with open("config.json") as json_data_file:
data = json.load(json_data_file)
shopifyLinks = data['shopifySitemapLinks']
linkToAdd = # I want this to be the input from the /command [input]
data['shopifySitemapLinks'].append(linkToAdd)
json.dump(data, sys.stdout, indent=2)
with open('config.json', 'w') as json_data:
json.dump(data, json_data, indent=2)
return 'hi'
if __name__ == "__main__":
port = int(os.environ.get("PORT", 5000))
app.run(host="0.0.0.0", port=port, debug=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment