diff --git a/backend/src/voice/voice.service.ts b/backend/src/voice/voice.service.ts index b28f975..d214d79 100644 --- a/backend/src/voice/voice.service.ts +++ b/backend/src/voice/voice.service.ts @@ -8,13 +8,16 @@ export class VoiceService { constructor(private configService: ConfigService) { this.logger.log('Initializing VoiceService...'); - const voiceServiceHost = this.configService.get('VOICE_SERVICE_HOST'); + var voiceServiceHost = this.configService.get('VOICE_SERVICE_HOST'); if (!voiceServiceHost) { const error = 'VOICE_SERVICE_HOST environment variable is not set'; this.logger.error(error); throw new Error(error); } + while (voiceServiceHost.endsWith('/')) { + voiceServiceHost = voiceServiceHost.slice(0, -1); + } this.voiceServiceUrl = voiceServiceHost; this.logger.log(`VoiceService initialized with URL: ${this.voiceServiceUrl}`);