Skip to content

Commit

Permalink
config: Changed ReadMe and .env files
Browse files Browse the repository at this point in the history
  • Loading branch information
mananjadhav committed Feb 9, 2022
1 parent bbfbc2b commit b760e47
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
EXPENSIFY_URL_CASH=https://new.expensify.com/
NEW_EXPENSIFY_URL=https://new.expensify.com/
EXPENSIFY_URL_SECURE=https://secure.expensify.com.dev/
EXPENSIFY_URL_COM=https://www.expensify.com.dev/
EXPENSIFY_URL=https://www.expensify.com.dev/
EXPENSIFY_PARTNER_NAME=chat-expensify-com
EXPENSIFY_PARTNER_PASSWORD=e21965746fd75f82bb66
PUSHER_APP_KEY=ac6d22b891daae55283a
Expand Down
4 changes: 2 additions & 2 deletions .env.production
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
EXPENSIFY_URL_CASH=https://new.expensify.com/
NEW_EXPENSIFY_URL=https://new.expensify.com/
EXPENSIFY_URL_SECURE=https://secure.expensify.com/
EXPENSIFY_URL_COM=https://www.expensify.com/
EXPENSIFY_URL=https://www.expensify.com/
EXPENSIFY_PARTNER_NAME=chat-expensify-com
EXPENSIFY_PARTNER_PASSWORD=e21965746fd75f82bb66
PUSHER_APP_KEY=268df511a204fbb60884
Expand Down
4 changes: 2 additions & 2 deletions .env.staging
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
EXPENSIFY_URL_CASH=https://staging.new.expensify.com/
NEW_EXPENSIFY_URL=https://staging.new.expensify.com/
EXPENSIFY_URL_SECURE=https://secure.expensify.com/
EXPENSIFY_URL_COM=https://www.expensify.com/
EXPENSIFY_URL=https://www.expensify.com/
EXPENSIFY_PARTNER_NAME=chat-expensify-com
EXPENSIFY_PARTNER_PASSWORD=e21965746fd75f82bb66
PUSHER_APP_KEY=268df511a204fbb60884
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ For an M1 Mac, read this [SO](https://stackoverflow.com/c/expensify/questions/11
Creating an `.env` file is not necessary. We advise external contributors against it. It can lead to errors when
variables referenced here get updated since your local `.env` file is ignored.

- `EXPENSIFY_URL_CASH` - The root URL used for the website
- `NEW_EXPENSIFY_URL` - The root URL used for the website
- `EXPENSIFY_URL_SECURE` - The URL used to hit the Expensify secure API
- `EXPENSIFY_URL_COM` - The URL used to hit the Expensify API
- `EXPENSIFY_URL` - The URL used to hit the Expensify API
- `EXPENSIFY_PARTNER_NAME` - Constant used for the app when authenticating.
- `EXPENSIFY_PARTNER_PASSWORD` - Another constant used for the app when authenticating. (This is OK to be public)
- `PUSHER_APP_KEY` - Key used to authenticate with Pusher.com
Expand Down
6 changes: 3 additions & 3 deletions src/CONFIG.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import CONST from './CONST';

// Set default values to contributor friendly values to make development work out of the box without an .env file
const ENVIRONMENT = lodashGet(Config, 'ENVIRONMENT', CONST.ENVIRONMENT.DEV);
const newExpensifyURL = Url.addTrailingForwardSlash(lodashGet(Config, 'EXPENSIFY_URL_CASH', 'https://new.expensify.com/'));
const expensifyURL = Url.addTrailingForwardSlash(lodashGet(Config, 'EXPENSIFY_URL_COM', 'https://www.expensify.com/'));
const newExpensifyURL = Url.addTrailingForwardSlash(lodashGet(Config, 'NEW_EXPENSIFY_URL', 'https://new.expensify.com/'));
const expensifyURL = Url.addTrailingForwardSlash(lodashGet(Config, 'EXPENSIFY_URL', 'https://www.expensify.com/'));
const ngrokURL = Url.addTrailingForwardSlash(lodashGet(Config, 'NGROK_URL', ''));
const secureNgrokURL = Url.addTrailingForwardSlash(lodashGet(Config, 'SECURE_NGROK_URL', ''));
const expensifyURLSecure = Url.addTrailingForwardSlash(lodashGet(
Expand All @@ -21,7 +21,7 @@ const expensifyComWithProxy = getPlatform() === 'web' && useWebProxy ? '/' : exp
// Throw errors on dev if config variables are not set correctly
if (ENVIRONMENT === CONST.ENVIRONMENT.DEV) {
if (!useNgrok && expensifyURL.includes('dev') && !expensifyURLSecure.includes('dev')) {
throw new Error('EXPENSIFY_URL_SECURE must end with .dev when EXPENSIFY_URL_COM ends with .dev');
throw new Error('EXPENSIFY_URL_SECURE must end with .dev when EXPENSIFY_URL ends with .dev');
}

if (useNgrok && !secureNgrokURL) {
Expand Down

0 comments on commit b760e47

Please sign in to comment.