From 20a6127dee4f1a57be974e566ecc0e0ba51478ba Mon Sep 17 00:00:00 2001 From: felixwelter <felixwelter@gmail.com> Date: Tue, 25 Aug 2020 09:23:15 +0200 Subject: [PATCH] Make host configurable --- .gitignore | 1 + app.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 485dee6..e04276f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .idea +venv diff --git a/app.py b/app.py index e15e630..dbbab1e 100644 --- a/app.py +++ b/app.py @@ -1,9 +1,10 @@ from flask import Flask, render_template, request, redirect, send_file from elasticsearch_dsl import connections, Search +import os app = Flask(__name__) -connections.create_connection(hosts=['34.121.207.248:9200'], timeout=20) +connections.create_connection(hosts=[os.getenv('ES_HOST', 'localhost')], timeout=20) @app.route('/search') @@ -43,4 +44,4 @@ def index(): if __name__ == '__main__': app.debug = True - app.run(host="0.0.0.0") + app.run(host="0.0.0.0", port=5000) -- GitLab