Cleanup default values and leftover methods in environmentService (#4550)

* Cleanup default values and leftover methods in environmentService

* Adress remainings configService calls
This commit is contained in:
Félix Malfait
2024-03-18 17:09:39 +01:00
committed by GitHub
parent 1cc8bdd3e9
commit bdbd77c696
15 changed files with 110 additions and 172 deletions

View File

@ -0,0 +1,11 @@
import { Request } from 'express';
export const getServerUrl = (
request: Request,
serverUrlEnv: string,
): string => {
if (serverUrlEnv?.endsWith('/'))
return serverUrlEnv.substring(0, serverUrlEnv.length - 1);
return serverUrlEnv || `${request.protocol}://${request.get('host')}`;
};