1.6 KiB
1.6 KiB
Worker Environment Switching Guide
Quick Switch Commands
Switch to Dev Environment (Default)
./switch-worker-env.sh dev
Switch to Production Environment
./switch-worker-env.sh production
Switch to Local Environment
./switch-worker-env.sh local
Manual Switching
You can also manually edit the environment by:
-
Option 1: Set environment variable
export VITE_WORKER_ENV=dev -
Option 2: Edit
.env.localfileVITE_WORKER_ENV=dev -
Option 3: Edit
src/constants/workerUrl.tsdirectlyconst WORKER_ENV = 'dev' // Change this line
Available Environments
| Environment | URL | Description |
|---|---|---|
local |
http://localhost:5172 |
Local worker (requires npm run dev:worker:local) |
dev |
https://jeffemmett-canvas-automerge-dev.jeffemmett.workers.dev |
Cloudflare dev environment |
production |
https://jeffemmett-canvas.jeffemmett.workers.dev |
Production environment |
Current Status
- ✅ Dev Environment: Working with AutomergeDurableObject
- ✅ R2 Data Loading: Fixed format conversion
- ✅ WebSocket: Improved with keep-alive and reconnection
- 🔄 Production: Ready to deploy when testing is complete
Testing the Fix
- Switch to dev environment:
./switch-worker-env.sh dev - Start your frontend:
npm run dev - Check browser console for environment logs
- Test R2 data loading in your canvas app
- Verify WebSocket connections are stable