Skip to content

Commit

Permalink
Merge branch 'main' of github.com:r0fls/soad
Browse files Browse the repository at this point in the history
  • Loading branch information
r0fls committed Nov 29, 2024
2 parents 7d42b66 + a10ee05 commit 695b5c8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 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/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Login = () => {
if (response.status === 200 && response.data.access_token) {
setToken(response.data.access_token);
console.log('Token set, navigating to /'); // Debug log for navigation
navigate('/');
setTimeout(navigate, 0, '/');
} else {
setError('Invalid username or password');
}
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 695b5c8

Please sign in to comment.