HL7-1: fix dev environment connecting to wss://
This commit is contained in:
parent
1402b4f1ed
commit
ad48df97e5
1 changed files with 2 additions and 1 deletions
|
@ -16,6 +16,7 @@
|
||||||
import { Label } from '$lib/components/ui/dropdown-menu';
|
import { Label } from '$lib/components/ui/dropdown-menu';
|
||||||
import { env } from '$env/dynamic/public';
|
import { env } from '$env/dynamic/public';
|
||||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '$lib/components/ui/tooltip';
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '$lib/components/ui/tooltip';
|
||||||
|
import { dev } from '$app/environment';
|
||||||
|
|
||||||
// connection state
|
// connection state
|
||||||
let ws = $state<WebSocket | undefined>(undefined);
|
let ws = $state<WebSocket | undefined>(undefined);
|
||||||
|
@ -64,7 +65,7 @@
|
||||||
console.log('Connecting to server...');
|
console.log('Connecting to server...');
|
||||||
connectionState = ConnectionState.connecting;
|
connectionState = ConnectionState.connecting;
|
||||||
|
|
||||||
const socket = new WebSocket(`wss://${env.PUBLIC_SERVER}`);
|
const socket = new WebSocket(`${dev ? 'ws' : 'wss'}://${env.PUBLIC_SERVER}`);
|
||||||
|
|
||||||
socket.onopen = () => {
|
socket.onopen = () => {
|
||||||
console.log('WebSocket connection established.');
|
console.log('WebSocket connection established.');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue