Skip to content

Commit

Permalink
Merge pull request #91 from zacuke/main
Browse files Browse the repository at this point in the history
utilize process.env
  • Loading branch information
r0fls authored Nov 29, 2024
2 parents 626e278 + 297b6f8 commit a10ee05
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,15 @@ We welcome contributions to the SOAD project. Here are some ways you can help:
4. Start the frontend (React) server
NOTE: right now you will have to edit this line in `src/axiosInstance.js` file locally to point to `http://localhost:8000`:
https://github.com/r0fls/soad/blob/main/trading-dashboard/src/axiosInstance.js#L4
Create a file called `/trading-dashboard/.env.local` with this line:
```
REACT_APP_API_URL=http://localhost:8000
```
To prevent `package.json` from [unexpectedly changing](https://github.com/nodejs/corepack/issues/485) set this environment variable:
```
COREPACK_ENABLE_AUTO_PIN=0
```
Then:
Expand Down
2 changes: 1 addition & 1 deletion trading-dashboard/src/axiosInstance.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from 'axios';
import history from './history';

const baseURL = '$REACT_API_URL';
const baseURL = process.env.REACT_APP_API_URL || '$REACT_API_URL';

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

0 comments on commit a10ee05

Please sign in to comment.