Skip to content

Commit

Permalink
Added React app debug logs.
Browse files Browse the repository at this point in the history
Added correct endpoint.
  • Loading branch information
raresgaia123 committed Nov 16, 2023
1 parent 6acb55c commit a709829
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ scripts/openapi
# helm dependencies
charts
requirements.lock

# React dependencies
node_modules
2 changes: 1 addition & 1 deletion dashboard/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<script src="%PUBLIC_URL%/config.js"></script>
<script src="%PUBLIC_URL%/api-config.js"></script>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
6 changes: 4 additions & 2 deletions dashboard/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import './App.css';
function App() {

useEffect(() => {
console.log((window as unknown as any).env);
})
const REACT_APP_API_URL = (window as unknown as any).env?.REACT_APP_API_URL;

fetch(`${REACT_APP_API_URL}/users/foo/designs`);
}, [])
return (
<div className="App">
<header className="App-header">
Expand Down

0 comments on commit a709829

Please sign in to comment.