Skip to content

Commit

Permalink
🚚 fix hardcoded backend url into env dependent
Browse files Browse the repository at this point in the history
  • Loading branch information
heytulsiprasad committed Sep 23, 2020
1 parent 18544f7 commit 1b6defc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,17 @@ import FourOhFour from "./containers/FourOhFour";

import { setAuthState } from "./redux/actions/authActions";

const backendURL =
process.env.NODE_ENV === "production"
? process.env.REACT_APP_BACKEND_PROD_URL
: process.env.REACT_APP_BACKEND_DEV_URL;

const App = ({ isAuth, setAuthState }) => {
const [isLoading, setIsLoading] = useState(true);

useEffect(() => {
axios
.get("http://localhost:5000/auth/state", { withCredentials: true })
.get(`${backendURL}/auth/state`, { withCredentials: true })
.then((res) => {
setAuthState(res.data);
setIsLoading(false);
Expand Down

1 comment on commit 1b6defc

@vercel
Copy link

@vercel vercel bot commented on 1b6defc Sep 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.