Skip to content

Commit

Permalink
attempt to add env var to FE
Browse files Browse the repository at this point in the history
  • Loading branch information
seplee committed Apr 14, 2024
1 parent b6ebc9b commit 27644bb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"build-production": "REACT_APP_ENV=production react-scripts build",
"build-place": "react-scripts build; cp -Rp build ../api/",
"test": "react-scripts test",
"eject": "react-scripts eject"
Expand Down
1 change: 1 addition & 0 deletions web/src/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REACT_APP_API_ROOT=https://drive-gooder.com/api
1 change: 1 addition & 0 deletions web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function App() {
// send a request to a protected endpoint on the server for the user's info
// if the response is successful, set loggedIn to true and redirect to protected route
console.log(`logged in? ${loggedIn}`);
console.log(`root domain is: ${process.env.REACT_APP_API_ROOT}`);

if (!loggedIn) {
return <UnauthenticatedTemplate loginCallback={handleLogin} />;
Expand Down
1 change: 1 addition & 0 deletions web/src/component/OAuthLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default function OAuthLogin(props: OAuthLoginProps) {
return (
<Box display="flex" justifyContent="center" alignItems="center">
<FormControl>
<h1>testing</h1>
<Button onClick={handleOauth}>OAuth2 Login</Button>
</FormControl>
</Box>
Expand Down

0 comments on commit 27644bb

Please sign in to comment.