feat: In Production only Show one Community

This commit is contained in:
Moriz Wahl 2021-10-12 21:28:29 +02:00
parent 29de8e224f
commit f2ec81e2b2
3 changed files with 14 additions and 5 deletions

View File

@ -1,3 +1,4 @@
PRODUCTION=
PORT=4000
JWT_SECRET=secret123
JWT_EXPIRES_IN=10m

View File

@ -11,6 +11,7 @@ const server = {
LOGIN_API_URL: process.env.LOGIN_API_URL || 'http://login-server:1201/',
COMMUNITY_API_URL: process.env.COMMUNITY_API_URL || 'http://nginx/api/',
GDT_API_URL: process.env.GDT_API_URL || 'https://gdt.gradido.net',
PRODUCTION: process.env.PRODUCTION === 'true' || false,
}
const database = {

View File

@ -19,9 +19,17 @@ export class CommunityResolver {
@Query(() => [Community])
async communities(): Promise<Community[]> {
const communities: Community[] = []
communities.push(
if (CONFIG.PRODUCTION)
return [
new Community({
id: 3,
name: 'Gradido-Akademie',
description: 'Freies Institut für Wirtschaftsbionik.',
url: 'https://gradido.net',
registerUrl: 'https://gdd1.gradido.com/vue/register-community',
}),
]
return [
new Community({
id: 1,
name: 'Gradido Entwicklung',
@ -43,7 +51,6 @@ export class CommunityResolver {
url: 'https://gradido.net',
registerUrl: 'https://gdd1.gradido.com/vue/register-community',
}),
)
return communities
]
}
}