Skip to content

Commit f2780e1

Browse files
jiachen247martin-henz
authored andcommitted
update .env.example template for clarity (#430)
1 parent 3e6a014 commit f2780e1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
REACT_APP_IVLE_KEY=your_ivle_key_here
22
REACT_APP_VERSION=$npm_package_version
3-
REACT_APP_BACKEND_URL=http://something.com
4-
REACT_APP_USE_BACKEND=
3+
REACT_APP_BACKEND_URL=http://localhost:4001
4+
REACT_APP_USE_BACKEND=TRUE

src/utils/constants.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ dotenv.config()
55
export const IVLE_KEY = process.env.REACT_APP_IVLE_KEY
66
export const VERSION = process.env.REACT_APP_VERSION
77
export const BACKEND_URL = process.env.REACT_APP_BACKEND_URL
8-
export const USE_BACKEND = process.env.REACT_APP_USE_BACKEND
8+
export const USE_BACKEND =
9+
process.env.REACT_APP_USE_BACKEND !== '' &&
10+
process.env.REACT_APP_USE_BACKEND!.toUpperCase() === 'TRUE'
911

1012
export enum LINKS {
1113
GITHUB_ISSUES = 'https://github.com/source-academy/cadet-frontend/issues',

0 commit comments

Comments
 (0)