From a941d06b5579c93c85e7f25f4eff7ed92bca1ef5 Mon Sep 17 00:00:00 2001 From: Claus-Peter Huebner Date: Mon, 18 Dec 2023 18:17:46 +0100 Subject: [PATCH] configure gms-url instead of host and port --- backend/src/apis/gms/GmsClient.ts | 8 ++++---- backend/src/config/index.ts | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/backend/src/apis/gms/GmsClient.ts b/backend/src/apis/gms/GmsClient.ts index 2767324e5..46fa64006 100644 --- a/backend/src/apis/gms/GmsClient.ts +++ b/backend/src/apis/gms/GmsClient.ts @@ -12,7 +12,7 @@ import { GmsUser } from './model/GmsUser' /* export async function communityList(): Promise { - const baseUrl = 'https://'.concat(CONFIG.GMS_HOST).concat(':').concat(CONFIG.GMS_PORT).concat('/') + const baseUrl = CONFIG.GMS_URL.endsWith('/') ? CONFIG.GMS_URL : CONFIG.GMS_URL.concat('/') const service = 'community/list?page=1&perPage=20' const config = { headers: { @@ -44,7 +44,7 @@ export async function communityList(): Promise { - const baseUrl = 'https://'.concat(CONFIG.GMS_HOST).concat(':').concat(CONFIG.GMS_PORT).concat('/') + const baseUrl = CONFIG.GMS_URL.endsWith('/') ? CONFIG.GMS_URL : CONFIG.GMS_URL.concat('/') const service = 'community-user/list?page=1&perPage=20' const config = { headers: { @@ -80,7 +80,7 @@ export async function userList(): Promise { } export async function userByUuid(uuid: string): Promise { - const baseUrl = 'https://'.concat(CONFIG.GMS_HOST).concat(':').concat(CONFIG.GMS_PORT).concat('/') + const baseUrl = CONFIG.GMS_URL.endsWith('/') ? CONFIG.GMS_URL : CONFIG.GMS_URL.concat('/') const service = 'community-user/list?page=1&perPage=20' const config = { headers: { @@ -117,7 +117,7 @@ export async function userByUuid(uuid: string): Promise { - const baseUrl = 'http://'.concat(CONFIG.GMS_HOST).concat(':').concat(CONFIG.GMS_PORT).concat('/') + const baseUrl = CONFIG.GMS_URL.endsWith('/') ? CONFIG.GMS_URL : CONFIG.GMS_URL.concat('/') const service = 'community-user' const config = { headers: { diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index 98698a731..1c88fcd8e 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -137,8 +137,7 @@ const federation = { const gms = { GMS_ACTIVE: process.env.GMS_ACTIVE === 'true' || false, // koordinates of Illuminz-instance of GMS - GMS_HOST: process.env.GMS_HOST ?? 'localhost', - GMS_PORT: process.env.GMS_PORT ?? '4044', + GMS_URL: process.env.GMS_HOST ?? 'http://localhost:4044/', } export const CONFIG = {