File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 11export declare const normalizeOrigin : ( origin ?: string ) => string ;
2- export declare const DEFAULT_API_ORIGIN : string ;
2+ export declare const INTERNAL_API_ORIGIN : string ;
3+ export declare const PUBLIC_API_ORIGIN : string ;
34export declare const API_ORIGIN : string ;
Original file line number Diff line number Diff line change 11const normalizeOrigin = ( origin ) => ( origin ?? "" ) . replace ( / \/ + $ / , "" ) ;
22
3- const DEFAULT_API_ORIGIN = normalizeOrigin ( "http://128.0.0.255:8080" ) ;
4- const API_ORIGIN = DEFAULT_API_ORIGIN ;
3+ const INTERNAL_API_ORIGIN = normalizeOrigin ( "http://128.0.0.255:8080" ) ;
4+ const PUBLIC_API_ORIGIN = normalizeOrigin ( "https://cmnw.me" ) ;
5+
6+ const isServerRuntime = ( ) => typeof window === "undefined" ;
7+
8+ const API_ORIGIN = isServerRuntime ( ) ? INTERNAL_API_ORIGIN : PUBLIC_API_ORIGIN ;
59
610module . exports = {
711 API_ORIGIN ,
8- DEFAULT_API_ORIGIN ,
12+ INTERNAL_API_ORIGIN ,
13+ PUBLIC_API_ORIGIN ,
914 normalizeOrigin,
1015} ;
You can’t perform that action at this time.
0 commit comments