Adapt react-client to use the real backend API (#1545)

Co-authored-by: Philip Molares <philip.molares@udo.edu>
Co-authored-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Erik Michelson 2022-04-15 23:03:15 +02:00 committed by GitHub
parent 3399ed2023
commit 26f90505ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
227 changed files with 4726 additions and 2310 deletions

View file

@ -4,23 +4,20 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { isPositiveAnswer } from './is-positive-answer'
/**
* Checks if the current runtime is built in e2e test mode.
*/
export const isTestMode = (): boolean => {
return process.env.NEXT_PUBLIC_TEST_MODE === 'true'
}
export const isTestMode = !!process.env.NEXT_PUBLIC_TEST_MODE && isPositiveAnswer(process.env.NEXT_PUBLIC_TEST_MODE)
/**
* Checks if the current runtime should use the mocked backend.
*/
export const isMockMode = (): boolean => {
return process.env.NEXT_PUBLIC_USE_MOCK_API === 'true'
}
export const isMockMode =
!!process.env.NEXT_PUBLIC_USE_MOCK_API && isPositiveAnswer(process.env.NEXT_PUBLIC_USE_MOCK_API)
/**
* Checks if the current runtime was built in development mode.
*/
export const isDevMode = (): boolean => {
return process.env.NODE_ENV === 'development'
}
export const isDevMode = process.env.NODE_ENV === 'development'