A Cloudflare Worker that provides a stable URL for accessing the latest Development.netcanvas asset from the Network Canvas monorepo releases.
This worker solves the problem of accessing the latest Development Protocol release assets without CORS issues. Instead of manually tracking GitHub releases or dealing with cross-origin restrictions, this worker:
- Fetches all releases from the Network Canvas monorepo
- Identifies development protocol releases using the naming pattern:
@codaco/development-protocol-YYYYMMDDHHMMSS-SHA - Sorts releases by timestamp to find the most recent one
- Serves the
Development.netcanvasasset with proper CORS headers
Once deployed, simply make a GET request to your worker's URL:
curl https://your-worker.your-subdomain.workers.dev/The worker will respond with the latest Development.netcanvas file, including appropriate headers for cross-origin access.
- pnpm package manager
- Wrangler CLI (included as dev dependency)
# Install dependencies
pnpm install
# Start development server
pnpm devThe development server will be available at http://localhost:8787/.
# Run all tests
pnpm testTests are written using Vitest with Cloudflare Workers pool, supporting both unit and integration testing styles.
# Deploy to Cloudflare Workers
pnpm deployThe worker is configured through wrangler.jsonc:
- Entry point:
src/index.ts - Compatibility date: 2025-09-26
- Observability: Enabled
Returns the Development.netcanvas file with headers:
Content-Type: Based on the asset's content typeContent-Disposition:attachment; filename="Development.netcanvas"Access-Control-Allow-Origin:*Cache-Control:public, max-age=300(5 minutes)
- 404: No development protocol releases found or asset not found in release
- 500: GitHub API errors or network issues
The worker handles CORS preflight requests (OPTIONS) and includes appropriate headers for cross-origin access.
The worker implements a simple fetch handler that:
- Queries the GitHub API for all releases
- Filters releases matching the development protocol naming pattern
- Sorts by embedded timestamp to find the latest
- Fetches and proxies the Development.netcanvas asset
- Adds CORS headers for browser compatibility
Private project.