Skip to content

Commit 5807831

Browse files
committed
Update constants.ts
1 parent ceb0ea3 commit 5807831

File tree

1 file changed

+1
-32
lines changed

1 file changed

+1
-32
lines changed

sdk/src/constants.ts

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,7 @@ export const IS_DEV = env.NEXT_PUBLIC_CB_ENVIRONMENT === 'dev'
66
export const IS_TEST = env.NEXT_PUBLIC_CB_ENVIRONMENT === 'test'
77
export const IS_PROD = !IS_DEV && !IS_TEST
88

9-
const normalizeLocalWebPort = (inputEnv: NodeJS.ProcessEnv): string => {
10-
const port = inputEnv.NEXT_PUBLIC_WEB_PORT
11-
if (port && /^\d+$/.test(port)) {
12-
return port
13-
}
14-
return String(env.NEXT_PUBLIC_WEB_PORT ?? 3000)
15-
}
16-
17-
export const resolveWebsiteUrl = (
18-
inputEnv: NodeJS.ProcessEnv = process.env,
19-
): string => {
20-
const explicitUrl =
21-
inputEnv.NEXT_PUBLIC_CODEBUFF_APP_URL || env.NEXT_PUBLIC_CODEBUFF_APP_URL
22-
if (explicitUrl) {
23-
return explicitUrl
24-
}
25-
26-
const envName = inputEnv.NEXT_PUBLIC_CB_ENVIRONMENT
27-
const isProdEnv =
28-
envName === undefined
29-
? IS_PROD
30-
: envName !== 'dev' && envName !== 'test'
31-
32-
if (isProdEnv) {
33-
return 'https://codebuff.com'
34-
}
35-
36-
const port = normalizeLocalWebPort(inputEnv)
37-
return `http://localhost:${port}`
38-
}
39-
40-
export const WEBSITE_URL = resolveWebsiteUrl()
9+
export const WEBSITE_URL = env.NEXT_PUBLIC_CODEBUFF_APP_URL
4110

4211
const DEFAULT_BACKEND_URL = 'manicode-backend.onrender.com'
4312
const DEFAULT_BACKEND_URL_DEV = 'localhost:4242'

0 commit comments

Comments
 (0)