File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 1- import { BACKEND_DOMAIN } from 'common/envs/constants'
1+ import { BACKEND_DOMAIN , IS_LOCAL } from 'common/envs/constants'
22
33type ErrorCode =
44 | 400 // your input is bad (like zod is mad)
@@ -27,12 +27,11 @@ export function pathWithPrefix(path: string) {
2727}
2828
2929export function getWebsocketUrl ( ) {
30- const protocol = BACKEND_DOMAIN . startsWith ( 'localhost' ) ? 'ws' : 'wss'
31-
30+ const protocol = IS_LOCAL ? 'ws' : 'wss'
3231 return `${ protocol } ://${ BACKEND_DOMAIN } /ws`
3332}
3433
3534export function getApiUrl ( path : string ) {
36- const protocol = BACKEND_DOMAIN . startsWith ( 'localhost' ) ? 'http' : 'https'
35+ const protocol = IS_LOCAL ? 'http' : 'https'
3736 return `${ protocol } ://${ BACKEND_DOMAIN } /${ prefix } /${ path } `
3837}
You can’t perform that action at this time.
0 commit comments