From 5639bb8e879ee403a66239d8eef568457af59136 Mon Sep 17 00:00:00 2001 From: DylanBanta Date: Sun, 25 May 2025 22:22:50 -0400 Subject: [PATCH] Updates to point to excalidraw-storage-backend --- .env.production | 4 ++-- docker-compose.yml | 6 +++--- excalidraw-app/App.tsx | 23 ++++++++++++++--------- excalidraw-app/package.json | 4 ++-- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/.env.production b/.env.production index 11e9fd84b..0aaa7765e 100644 --- a/.env.production +++ b/.env.production @@ -1,5 +1,5 @@ -VITE_APP_BACKEND_V2_GET_URL=https://json.excalidraw.com/api/v2/ -VITE_APP_BACKEND_V2_POST_URL=https://json.excalidraw.com/api/v2/post/ +VITE_APP_BACKEND_V2_GET_URL=https://ex.dylanbanta.com/api/v2/scenes/ +VITE_APP_BACKEND_V2_POST_URL=https://ex.dylanbanta.com/api/v2/scenes/ VITE_APP_LIBRARY_URL=https://libraries.excalidraw.com VITE_APP_LIBRARY_BACKEND=https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries diff --git a/docker-compose.yml b/docker-compose.yml index b82053e57..bb1968234 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,7 +19,7 @@ services: - ./:/opt/node_app/app:delegated - ./package.json:/opt/node_app/package.json - ./yarn.lock:/opt/node_app/yarn.lock - - notused:/opt/node_app/app/node_modules +# - notused:/opt/node_app/app/node_modules -volumes: - notused: +# volumes: +# notused: diff --git a/excalidraw-app/App.tsx b/excalidraw-app/App.tsx index 932743ddf..75766e2fd 100644 --- a/excalidraw-app/App.tsx +++ b/excalidraw-app/App.tsx @@ -926,16 +926,21 @@ const ExcalidrawWrapper = () => { { - if (excalidrawAPI) { - try { - await onExportToBackend( - excalidrawAPI.getSceneElements(), - excalidrawAPI.getAppState(), - excalidrawAPI.getFiles(), - ); - } catch (error: any) { - setErrorMessage(error.message); + if (!excalidrawAPI) { + return; + } + try { + const { url, errorMessage } = await exportToBackend( + excalidrawAPI.getSceneElements(), + excalidrawAPI.getAppState(), + excalidrawAPI.getFiles(), + ); + if (errorMessage) { + throw new Error(errorMessage); } + setLatestShareableLink(url); + } catch (error: any) { + setErrorMessage(error.message); } }} /> diff --git a/excalidraw-app/package.json b/excalidraw-app/package.json index e5dcde033..939bdcfe1 100644 --- a/excalidraw-app/package.json +++ b/excalidraw-app/package.json @@ -41,8 +41,8 @@ "prettier": "@excalidraw/prettier-config", "scripts": { "build-node": "node ./scripts/build-node.js", - "build:app:docker": "cross-env VITE_APP_DISABLE_SENTRY=true vite build", - "build:app": "cross-env VITE_APP_GIT_SHA=$VERCEL_GIT_COMMIT_SHA cross-env VITE_APP_ENABLE_TRACKING=true vite build", + "build:app:docker": "vite build", + "build:app": "vite build", "build:version": "node ../scripts/build-version.js", "build": "yarn build:app && yarn build:version", "start": "yarn && vite",