From 4ed70beabc73dd9aa1d2e06ab5902ded0801c404 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 4 Mar 2022 16:49:41 +0100 Subject: chore: use a different configuration depending on app env It will be useful with Docker. Instead of cloning the project with a different configuration, I can manage two different configuration thanks to dotenv and some checking inside the app. --- src/services/graphql/api.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/services/graphql/api.ts') diff --git a/src/services/graphql/api.ts b/src/services/graphql/api.ts index 33cc89a..a5be026 100644 --- a/src/services/graphql/api.ts +++ b/src/services/graphql/api.ts @@ -1,8 +1,9 @@ import { RequestType, VariablesType } from '@ts/types/app'; +import { settings } from '@utils/config'; import { GraphQLClient } from 'graphql-request'; export const getGraphQLClient = (): GraphQLClient => { - const apiUrl: string = process.env.NEXT_PUBLIC_GRAPHQL_API || ''; + const apiUrl = settings.api.url; if (!apiUrl) throw new Error('API URL not defined.'); -- cgit v1.2.3