Skip to content

Commit

Permalink
WebUI detect URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Marekkon5 committed Jan 21, 2024
1 parent f8199aa commit a30d1b7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/src/scripts/utils.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// Returns the WebSocket server URL
function wsUrl(): string {
return `ws://${window.location.hostname}:36913/ws`;
return import.meta.env.DEV ? `ws://${window.location.hostname}:36913/ws` : `ws://${window.location.host}/ws`;
}

// Returns the HTTP server URL
function httpUrl(): string {
return `http://${window.location.hostname}:36913`;
return import.meta.env.DEV ? `http://${window.location.hostname}:36913` : `${window.location.origin}`;
}

// Returns the Spotify redirect URL
function spotifyUrl(): string {
return `http://127.0.0.1:36913/spotify`;
return `${httpUrl()}/spotify`;
}

// Tag value separators
Expand Down

0 comments on commit a30d1b7

Please sign in to comment.