MCPcopy Create free account
hub / github.com/N4si/microservices-python-app / get_db_connection

Function get_db_connection

src/auth-service/server.py:7–13  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5server = Flask(__name__)
6
7def get_db_connection():
8 conn = psycopg2.connect(host=os.getenv('DATABASE_HOST'),
9 database=os.getenv('DATABASE_NAME'),
10 user=os.getenv('DATABASE_USER'),
11 password=os.getenv('DATABASE_PASSWORD'),
12 port=5432)
13 return conn
14
15
16@server.route('/login', methods=['POST'])

Callers 1

loginFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected