-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created a seperate environment for development and production
- Loading branch information
1 parent
295689c
commit c38089e
Showing
9 changed files
with
48 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
MONGODB_URI=mongodb://127.0.0.1:27017/blackmarket | ||
JWT_SECRET=jwt_secret | ||
JWT_SECRET=jwt_secret | ||
CLIENT_ID=github_client_id | ||
CLIENT_SECRET=github_secret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import "dotenv/config"; | ||
|
||
const NODE_ENV = process.env.NODE_ENV; | ||
let corsUrls = []; | ||
const MONGODB_URI = process.env.MONGODB_URI; | ||
const JWT_PRIVATE_KEY = process.env.JWT_PRIVATE_KEY; | ||
const CLIENT_ID = process.env.CLIENT_ID; | ||
const CLIENT_SECRET = process.env.CLIENT_SECRET; | ||
|
||
console.log(MONGODB_URI, JWT_PRIVATE_KEY, CLIENT_ID, CLIENT_SECRET); | ||
|
||
if (NODE_ENV === "production") { | ||
const CLIENT_URL1 = process.env.CLIENT_URL1; | ||
const CLIENT_URL2 = process.env.CLIENT_URL2; | ||
|
||
corsUrls.push(CLIENT_URL1); | ||
corsUrls.push(CLIENT_URL2); | ||
} else if (NODE_ENV === "development") { | ||
const local_client = "http://localhost:3000"; | ||
corsUrls.push(local_client); | ||
} | ||
|
||
console.log(corsUrls); | ||
|
||
export { MONGODB_URI, JWT_PRIVATE_KEY, CLIENT_ID, CLIENT_SECRET, corsUrls }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters