Skip to content

Commit

Permalink
Some refactoring on env var so we have now url distinct from api path
Browse files Browse the repository at this point in the history
  • Loading branch information
Anne-Marie committed Aug 25, 2020
1 parent db30b70 commit 0a7225e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
REACT_APP_API_URL=
REACT_APP_API_PATH=
REACT_APP_BACK_BASE_URL=
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"test:serve": "REACT_APP_API_URL=/api/v1 BROWSER=none yarn start",
"test:serve": "REACT_APP_API_PATH=/api/v1 BROWSER=none yarn start",
"cypress:open": "cypress open",
"cypress:run": "cypress run --record",
"test:ui": " start-server-and-test test:serve 3000 cypress:run"
Expand Down
5 changes: 4 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ import * as serviceWorker from "./serviceWorker";
import { Theme } from "./ui/Theme/Theme";

const authToken = getOauthTokenOrRedirect();
const apiUrl = process.env.REACT_APP_API_URL!;

const apiPath = process.env.REACT_APP_API_PATH!;

const apiUrl = `${process.env.REACT_APP_BACK_BASE_URL}${apiPath}`;

const httpClient = createHttpClient(apiUrl, authToken);

Expand Down

0 comments on commit 0a7225e

Please sign in to comment.