File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 1+ VITE_WEBSOCKET_URL =
Original file line number Diff line number Diff line change 88- ` curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash `
99- ` nvm install 22 && nvm use 22 `
1010
11+ # Running locally
12+
13+ - Run ` cp .env.example .env.local `
14+ - Run ` npm run dev `
15+
1116## Build
1217
1318- Run ` npm ci `
Original file line number Diff line number Diff line change @@ -12,10 +12,16 @@ import {
1212 messageEventType ,
1313} from "./ConnectionContext" ;
1414
15+ const VITE_WEBSOCKET_URL = (
16+ import . meta. env . VITE_WEBSOCKET_URL as string
17+ ) . trim ( ) ;
18+
1519export function ConnectionProvider ( { children } : PropsWithChildren ) {
1620 const [ ctxValue , _setCtxValue ] = useState ( defaultCtxValue ) ;
1721 // connect to current host via websocket
18- const websocketUrl = `${ window . location . protocol . startsWith ( "https" ) ? "wss" : "ws" } ://${ window . location . hostname } :${ window . location . port } /websocket` ;
22+ const websocketUrl = VITE_WEBSOCKET_URL
23+ ? VITE_WEBSOCKET_URL
24+ : `${ window . location . protocol . startsWith ( "https" ) ? "wss" : "ws" } ://${ window . location . hostname } :${ window . location . port } /websocket` ;
1925
2026 const setSocketState = useSetAtom ( socketStateAtom ) ;
2127
You can’t perform that action at this time.
0 commit comments