Skip to content

Commit 7178d85

Browse files
committed
"fix(client): read SignalR hub URL from VITE_SIGNALR_HUB_URL env"
1 parent 70e3c5f commit 7178d85

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

client/src/signalr/auctionHubClient.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ export interface AuctionHubHandlers {
2323
* the subscribers Map.
2424
*/
2525

26-
const HUB_URL = '/auctionHub';
26+
// SignalR hub URL. Reads from `VITE_SIGNALR_HUB_URL` at build time — the SPA can ship to a
27+
// different origin than the API (e.g. coiny.best for SPA + api.coiny.best for the hub). Falls
28+
// back to a same-origin relative path for local dev (`pnpm dev` proxies /auctionHub to localhost).
29+
const HUB_URL = import.meta.env.VITE_SIGNALR_HUB_URL ?? '/auctionHub';
2730

2831
let connection: HubConnection | null = null;
2932
const subscribers = new Map<string, AuctionHubHandlers>();

0 commit comments

Comments
 (0)