Skip to content

Commit

Permalink
Read Neo4j connection details from environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Mustafa Kerem Kurban committed Jun 7, 2024
1 parent 106f249 commit 20a4d03
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/citation/flask/server.py
Original file line number Diff line number Diff line change
@@ -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))

Expand Down

0 comments on commit 20a4d03

Please sign in to comment.