Skip to content

Instantly share code, notes, and snippets.

@sotelo
Created March 17, 2017 19:03
Show Gist options
  • Save sotelo/4475bf9c8c5242af8008e3f606b10fd8 to your computer and use it in GitHub Desktop.
Save sotelo/4475bf9c8c5242af8008e3f606b10fd8 to your computer and use it in GitHub Desktop.
Small flask example
from flask import Flask
from flask import request
from flask import jsonify
app = Flask(__name__)
@app.route("/")
def index():
return "Welcome"
@app.route("/sentiment", methods=["POST"])
def sentiment():
jsonData = request.get_json()
print("JSON:")
print(jsonData)
utterance = jsonData['utterance']
return "hello, I am a raccoon"
if __name__ == "__main__":
app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment