Skip to content

Commit 07a6551

Browse files
committed
API_URL - manage value from ENV (optional)
1 parent c323fbf commit 07a6551

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

env.sample

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
REACT_APP_BACKEND_SERVER='https://YOUR_API_URL/';

src/config/constant.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1+
let BACKEND_SERVER = null;
2+
if (process.env.REACT_APP_BACKEND_SERVER) {
3+
BACKEND_SERVER = process.env.REACT_APP_BACKEND_SERVER;
4+
} else {
5+
BACKEND_SERVER = "http://localhost:5000/api/";
6+
}
7+
18
export const BASENAME = ''; // don't add '/' at end off BASENAME
29
export const BASE_URL = '/app/dashboard/default';
310
export const BASE_TITLE = ' | React Datta Able ';
4-
export const API_SERVER = 'http://localhost:5000/api/';
11+
export const API_SERVER = BACKEND_SERVER;
512

613
export const CONFIG = {
714
layout: 'vertical', // disable on free version

0 commit comments

Comments
 (0)