generated from Real-Dev-Squad/website-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
setup: add package and env folr for different environment like dev, s…
…taging and prod
- Loading branch information
1 parent
1be31df
commit deb037d
Showing
7 changed files
with
39 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
NEXT_PUBLIC_API_BASE_URL=http://localhost:8000/v1 | ||
NEXT_PUBLIC_BASE_SHORT_URL=http://localhost:3000 |
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,2 @@ | ||
NEXT_PUBLIC_API_BASE_URL=https://staging-tinysite-api.realdevsquad.com/v1 | ||
NEXT_PUBLIC_BASE_SHORT_URL=https://staging-tinysite.realdevsquad.com |
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,2 @@ | ||
NEXT_PUBLIC_API_BASE_URL=https://staging-tinysite-api.realdevsquad.com/v1 | ||
NEXT_PUBLIC_BASE_SHORT_URL=https://staging-tinysite.realdevsquad.com |
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,4 +1,18 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {}; | ||
|
||
module.exports = nextConfig; | ||
const dotenv = require('dotenv'); | ||
|
||
const envFiles = { | ||
development: '.env.development', | ||
staging: '.env.staging', | ||
production: '.env.production', | ||
}; | ||
|
||
dotenv.config({ path: envFiles[process.env.NODE_ENV] || '.env.local' }); | ||
|
||
module.exports = { | ||
reactStrictMode: true, | ||
env: { | ||
API_URL: process.env.API_URL, | ||
}, | ||
}; |
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,4 +1,6 @@ | ||
export const TINY_API_URL = 'https://staging-tinysite-api.realdevsquad.com/v1'; | ||
export const TINY_API_GOOGLE_LOGIN = `${TINY_API_URL}/auth/google/login`; | ||
export const TINY_API_LOGOUT = `${TINY_API_URL}/auth/logout`; | ||
export const BASE_SHORT_URL = 'https://staging-tinysite.realdevsquad.com'; | ||
const API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL || 'https://staging-tinysite-api.realdevsquad.com/v1'; | ||
export const BASE_SHORT_URL = process.env.NEXT_PUBLIC_BASE_SHORT_URL || 'https://staging-tinysite.realdevsquad.com'; | ||
|
||
export const TINY_API_URL = API_BASE_URL; | ||
export const TINY_API_GOOGLE_LOGIN = `${API_BASE_URL}/auth/google/login`; | ||
export const TINY_API_LOGOUT = `${API_BASE_URL}/auth/logout`; |
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