Skip to content

Commit

Permalink
specify api host and port in environment variables
Browse files Browse the repository at this point in the history
Signed-off-by: Paweł Cichowski <[email protected]>
  • Loading branch information
pcichowski committed Jun 6, 2024
1 parent 9423439 commit 84876d5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
REACT_APP_API_HOSTNAME=172.20.72.204
REACT_APP_API_PORT=18469
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ yarn

This project uses a modern version of `yarn` for package management

### API host and port

Configure the API connection in the `.env` file

## Available Scripts

In the project directory, you can run:
Expand Down
5 changes: 1 addition & 4 deletions src/core/apiConfig.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import axios from "axios";
import {Location} from "./domain/DomainInterfaces";

// deploying to docker cluster requires the 'gateway' hostname and probably a different port
// export const baseAPIURL = 'http://gateway:8082/';
export const baseAPIURL = 'http://localhost:8082/';
export const baseAPIURL = `http://${process.env.REACT_APP_API_HOSTNAME}:${process.env.REACT_APP_API_PORT}/`;

export const axiosInstance = axios.create({
baseURL: baseAPIURL,
Expand Down

0 comments on commit 84876d5

Please sign in to comment.