refactored monorepo for more projects

This commit is contained in:
Boki 2025-06-22 23:48:01 -04:00
parent 4632c174dc
commit 9492f1b15e
180 changed files with 1438 additions and 424 deletions

View file

@ -20,7 +20,7 @@ export function registerDatabaseServices(
port: parseInt(uriMatch?.[4] || '27017'),
database: config.mongodb.database,
username: uriMatch?.[1],
password: uriMatch?.[2],
password: uriMatch?.[2] ? String(uriMatch?.[2]) : undefined,
authSource: uriMatch?.[6] || 'admin',
uri: config.mongodb.uri,
};
@ -37,16 +37,19 @@ export function registerDatabaseServices(
if (config.postgres.enabled) {
container.register({
postgresClient: asFunction(({ logger }) => {
return new PostgreSQLClient(
{
host: config.postgres.host,
port: config.postgres.port,
database: config.postgres.database,
username: config.postgres.user,
password: config.postgres.password,
},
logger
);
const pgConfig = {
host: config.postgres.host,
port: config.postgres.port,
database: config.postgres.database,
username: config.postgres.user,
password: String(config.postgres.password), // Ensure password is a string
};
logger.debug('PostgreSQL config:', {
...pgConfig,
password: pgConfig.password ? '***' : 'NO_PASSWORD',
});
return new PostgreSQLClient(pgConfig, logger);
}).singleton(),
});
} else {