Created
August 11, 2017 14:48
-
-
Save hugolhafner/ded2d76fbbf8ebddf0989997acb07fc4 to your computer and use it in GitHub Desktop.
This file contains 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
@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