-
-
Notifications
You must be signed in to change notification settings - Fork 772
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
17 additions
and
9 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
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,12 @@ | ||
export const API_URL = | ||
process.env.NEXT_PUBLIC_API_URL || process.env.NEXT_PUBLIC_APIURL || '/api/v2' | ||
import { isClientSide, isDev } from '~/lib/env' | ||
|
||
export const API_URL = (() => { | ||
if (isDev) return process.env.NEXT_PUBLIC_API_URL | ||
|
||
if (isClientSide && process.env.NEXT_PUBLIC_CHINA_API_URL) { | ||
return process.env.NEXT_PUBLIC_CHINA_API_URL | ||
} | ||
|
||
return process.env.NEXT_PUBLIC_API_URL || '/api/v2' | ||
})() | ||
export const GATEWAY_URL = process.env.NEXT_PUBLIC_GATEWAY_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