Skip to content

Commit

Permalink
Configured NextJS API url environment variables; Production uses publ…
Browse files Browse the repository at this point in the history
…ic API
  • Loading branch information
Nathan7934 committed Feb 26, 2024
1 parent 5ef8256 commit 4d2c5b9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions frontend/.env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
EXTERNAL_API_URL=http://localhost:8080
DOMAIN_URL=http://localhost:3000
2 changes: 2 additions & 0 deletions frontend/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
EXTERNAL_API_URL=https://api.whosaidit.app
DOMAIN_URL=https://whosaidit.app
3 changes: 0 additions & 3 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

Expand Down
5 changes: 3 additions & 2 deletions frontend/app/constants.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// Stores the external SpringBoot API root:
export const EXTERNAL_API_ROOT: string = "http://localhost:8080/api";
export const EXTERNAL_API_ROOT: string = `${process.env.EXTERNAL_API_URL}/api`;


// Stores the internal NextJS API root:
export const INTERNAL_API_ROOT: string = "http://localhost:3000/api";

// Stores the domain URL:
export const DOMAIN_URL: string = "http://localhost:3000";
export const DOMAIN_URL: string = `${process.env.DOMAIN_URL}`;

// How long the user must hold on a message to select it in mobile layout (ms)
export const MOBILE_HOLD_DURATION = 400;
Expand Down

0 comments on commit 4d2c5b9

Please sign in to comment.