File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ import { BaseEntity } from '../models/index.js';
44import { DataBaseNamingStrategy } from './db-naming-strategy.js' ;
55import { GridFSBucket } from 'mongodb' ;
66
7+ function fixConnectionString ( cs : string ) {
8+ return / .+ \: \/ \/ .+ / . test ( cs ) ? cs : `mongodb://${ cs } ` ;
9+ }
10+
711/**
812 * Common connection config
913 */
@@ -13,7 +17,7 @@ export const COMMON_CONNECTION_CONFIG: any = {
1317 dbName : ( process . env . GUARDIAN_ENV || ( process . env . HEDERA_NET !== process . env . PREUSED_HEDERA_NET ) ) ?
1418 `${ process . env . GUARDIAN_ENV } _${ process . env . HEDERA_NET } _${ process . env . DB_DATABASE } ` :
1519 process . env . DB_DATABASE ,
16- clientUrl : `mongodb:// ${ process . env . DB_HOST } ` ,
20+ clientUrl : fixConnectionString ( process . env . DB_HOST ) ,
1721 entities : [
1822 'dist/entity/*.js'
1923 ]
You can’t perform that action at this time.
0 commit comments