Skip to content

Commit

Permalink
added env for react
Browse files Browse the repository at this point in the history
  • Loading branch information
Deepak-Sangle committed Nov 25, 2023
1 parent ce21484 commit 5e82728
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 deletions.
33 changes: 26 additions & 7 deletions web-client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"name": "dear-diary",
"version": "0.1.0",
"private": true,
"proxy": "https://dear-diary-api.onrender.com",
"dependencies": {
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^13.5.0",
"axios": "^1.5.0",
"dotenv": "^16.3.1",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-router-dom": "^6.16.0",
Expand Down
3 changes: 2 additions & 1 deletion web-client/src/constant.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { REACT_APP_SERVER_URI, REACT_APP_LOCAL_ENV} = process.env

const isDev = process.env.NODE_ENV === 'development' ;

module.exports = {
BASE_URI : !isDev ? "https://dear-diary-api.onrender.com" : "http://localhost:5000"
BASE_URI : !isDev ? REACT_APP_SERVER_URI : REACT_APP_LOCAL_ENV
}

0 comments on commit 5e82728

Please sign in to comment.