From f8db1fd2aa97a888dbfcc47dae19ad47881738aa Mon Sep 17 00:00:00 2001 From: Sam Deane Date: Wed, 21 Aug 2024 15:52:43 +0100 Subject: [PATCH] Log database config --- Sources/LilliputWeb/configure.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Sources/LilliputWeb/configure.swift b/Sources/LilliputWeb/configure.swift index aec7315..ff66db1 100644 --- a/Sources/LilliputWeb/configure.swift +++ b/Sources/LilliputWeb/configure.swift @@ -9,14 +9,18 @@ import LeafKit public func configure(_ app: Application, game: GameConfiguration) throws { - app.databases.use(DatabaseConfigurationFactory.postgres(configuration: .init( + let dbConfig = DatabaseConfigurationFactory.postgres(configuration: .init( hostname: Environment.get("DATABASE_HOST") ?? "localhost", port: Environment.get("DATABASE_PORT").flatMap(Int.init(_:)) ?? SQLPostgresConfiguration.ianaPortNumber, username: Environment.get("DATABASE_USERNAME") ?? "vapor", password: Environment.get("DATABASE_PASSWORD") ?? "vapor", database: Environment.get("DATABASE_NAME") ?? game.database, tls: .prefer(try .init(configuration: .clientDefault))) - ), as: .psql) + ) + + print("LilliputWeb db config \(dbConfig)") + + app.databases.use(dbConfig, as: .psql) app.sessions.use(.fluent)