Skip to content

Commit 5069cd9

Browse files
committed
Add ENDPOINT_ROOT to Env constants, replace usages.
1 parent 2a8599d commit 5069cd9

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

interface/src/constants/Endpoints.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const ENDPOINT_ROOT = process.env.REACT_APP_ENDPOINT_ROOT;
1+
import { ENDPOINT_ROOT } from '../constants/Env';
22

33
export const NTP_STATUS_ENDPOINT = ENDPOINT_ROOT + "ntpStatus";
44
export const NTP_SETTINGS_ENDPOINT = ENDPOINT_ROOT + "ntpSettings";

interface/src/constants/Env.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export const PROJECT_NAME = process.env.REACT_APP_PROJECT_NAME;
22
export const PROJECT_PATH = process.env.REACT_APP_PROJECT_PATH;
3+
export const ENDPOINT_ROOT = process.env.REACT_APP_ENDPOINT_ROOT;

interface/src/project/DemoController.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import React, { Component } from 'react';
2+
import { ValidatorForm } from 'react-material-ui-form-validator';
3+
4+
import { ENDPOINT_ROOT } from '../constants/Env';
25
import SectionContent from '../components/SectionContent';
36
import { restComponent } from '../components/RestComponent';
47
import LoadingNotification from '../components/LoadingNotification';
@@ -7,9 +10,8 @@ import Button from '@material-ui/core/Button';
710
import Typography from '@material-ui/core/Typography';
811
import Slider from '@material-ui/core/Slider';
912
import { makeStyles } from '@material-ui/core/styles';
10-
import { ValidatorForm } from 'react-material-ui-form-validator';
1113

12-
export const DEMO_SETTINGS_ENDPOINT = process.env.REACT_APP_ENDPOINT_ROOT + "demoSettings";
14+
export const DEMO_SETTINGS_ENDPOINT = ENDPOINT_ROOT + "demoSettings";
1315

1416
const valueToPercentage = (value) => `${Math.round(value / 255 * 100)}%`;
1517

0 commit comments

Comments
 (0)