Created
February 16, 2020 19:33
-
-
Save ashokc/7c2e8973b5cc0465d5572be3b22ce1dc 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
from flask import Flask, request, render_template, logging | |
from elasticsearch import Elasticsearch | |
client = Elasticsearch([{'host':'localhost','port':9200}]) | |
app = Flask(__name__) | |
@app.route('/quotes/byId', methods=['GET']) | |
def getById(): | |
docId = request.args.get('id') | |
quote = client.get(index=index, id=docId) | |
return render_template('quote.html',quote=quote) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment