Skip to content

Commit 83011ee

Browse files
committed
Add config
1 parent e60b8c3 commit 83011ee

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

src/config.dev.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export const config = {
2+
ga4Id: '',
3+
fhirpathApi: 'https://api.fhirpath.me'
4+
}

src/config.prod.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export const config = {
2+
ga4Id: 'G-N2QDCQM2M1',
3+
fhirpathApi: 'https://api.fhirpath.me'
4+
}

src/config.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { config as configProd } from './config.prod'
2+
import { config as configDev } from './config.dev'
3+
4+
export const config = process.env.NODE_ENV === 'production' ? configProd : configDev

src/hooks.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import { useEffect, useState } from "react";
33
import { EvaluateResponse } from "./interfaces";
44
import { toast } from 'react-toastify';
55
import { reqWrapper } from "./utils/requests";
6+
import { config } from './config'
67

78
export function useFHIRPathUI() {
8-
const fhirPathServiceURL = process.env.REACT_APP_FHIRPATH_URL || 'http://localhost:5000';
9+
const fhirPathServiceURL = config.fhirpathApi || 'http://localhost:5000';
910
const evaluateURL = fhirPathServiceURL + '/evaluate';
1011
const [url, setUrl] = useState<string>('');
1112
const [resource, setResource] = useState<string>('');

src/index.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import './index.css';
44
import App from './App';
55
import reportWebVitals from './reportWebVitals';
66
import ReactGA from "react-ga4";
7+
import { config } from './config'
78

89

9-
const measurementId = process.env.REACT_APP_GA4ID || ''
10-
if (measurementId) {
10+
const measurementId = config.ga4Id || ''
11+
if (measurementId) {
1112
ReactGA.initialize(measurementId);
1213
}
1314

0 commit comments

Comments
 (0)