mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Deployed sync server
This commit is contained in:
parent
f12ed8e0b2
commit
d2fed34a30
1 changed files with 12 additions and 2 deletions
|
@ -8,7 +8,14 @@ import throttle from "lodash.throttle";
|
|||
|
||||
export class ExcalidrawSyncClient {
|
||||
// TODO: add prod url
|
||||
private static readonly HOST_URL = "ws://localhost:8787";
|
||||
private static readonly HOST_URL = import.meta.env.DEV
|
||||
? "ws://localhost:8787"
|
||||
: "https://excalidraw-sync.marcel-529.workers.dev";
|
||||
|
||||
private static readonly ROOM_ID = import.meta.env.DEV
|
||||
? "test_room_dev"
|
||||
: "test_room_prod";
|
||||
|
||||
private static readonly RECONNECT_INTERVAL = 10_000;
|
||||
|
||||
private lastAcknowledgedVersion = 0;
|
||||
|
@ -27,7 +34,10 @@ export class ExcalidrawSyncClient {
|
|||
|
||||
private isConnecting: { done: (error?: Error) => void } | null = null;
|
||||
|
||||
constructor(api: ExcalidrawImperativeAPI, roomId: string = "test_room_1") {
|
||||
constructor(
|
||||
api: ExcalidrawImperativeAPI,
|
||||
roomId: string = ExcalidrawSyncClient.ROOM_ID,
|
||||
) {
|
||||
this.api = api;
|
||||
this.roomId = roomId;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue