Created
March 17, 2017 19:03
-
-
Save sotelo/4475bf9c8c5242af8008e3f606b10fd8 to your computer and use it in GitHub Desktop.
Small flask example
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
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