mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-15 15:44:45 -04:00
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:
parent
3399ed2023
commit
26f90505ff
227 changed files with 4726 additions and 2310 deletions
|
@ -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'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue