From 20a4d03eab918a8eaba46611b04b668e280435f5 Mon Sep 17 00:00:00 2001 From: Mustafa Kerem Kurban Date: Sat, 8 Jun 2024 00:08:39 +0200 Subject: [PATCH] Read Neo4j connection details from environment variables --- src/citation/flask/server.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/citation/flask/server.py b/src/citation/flask/server.py index 880e306..f06b78d 100644 --- a/src/citation/flask/server.py +++ b/src/citation/flask/server.py @@ -1,13 +1,14 @@ from flask import Flask, jsonify, render_template, request from neo4j import GraphDatabase import time +import os app = Flask(__name__, static_folder='../../../static', template_folder='../../../templates') -# Neo4j connection details -uri = "bolt://localhost:7687" -username = "neo4j" -password = "password" +# Neo4j connection details from environment variables +uri = os.getenv("NEO4J_URI", "bolt://localhost:7687") +username = os.getenv("NEO4J_USERNAME", "neo4j") +password = os.getenv("NEO4J_PASSWORD", "password") driver = GraphDatabase.driver(uri, auth=(username, password))