File tree Expand file tree Collapse file tree 1 file changed +1
-32
lines changed
Expand file tree Collapse file tree 1 file changed +1
-32
lines changed Original file line number Diff line number Diff line change @@ -6,38 +6,7 @@ export const IS_DEV = env.NEXT_PUBLIC_CB_ENVIRONMENT === 'dev'
66export const IS_TEST = env . NEXT_PUBLIC_CB_ENVIRONMENT === 'test'
77export 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
4211const DEFAULT_BACKEND_URL = 'manicode-backend.onrender.com'
4312const DEFAULT_BACKEND_URL_DEV = 'localhost:4242'
You can’t perform that action at this time.
0 commit comments