Cloudflare workers crypto

Comment

Author: Admin | 2025-04-28

Platform, it is much looser in itsrecommendations on how to upload the map file. It lists out the web interface (for small files), thepmtiles CLI, rclone and finally the AWS CLI. I'd recommend skipping straight to the AWS CLI.While the PMTiles CLI and rclone work great for small files, it seems that multi-part uploadscurrently do not work. Despite trying multiple different upload configurations (e.g. chunk size,maximum concurrency) these uploads would invariably fail with a SignatureDoesNotMatch error.Ultimately, for large files (the planet-size file is 110GB), the AWS CLI is the only option thatworks.To make the AWS CLI work all you need to do is:Configure an AWS profile with the Access Key ID and Secret Key that theCloudflare R2 API provides you.Upload your desired file to your R2 bucketaws s3 cp FILE.pmtiles s3://R2_BUCKET_NAME/ --endpoint-url https://CLOUDFLARE_ACCOUNT_ID.r2.cloudflarestorage.com --profile cloudflareR2 Worker And CORS Setup​After uploading your pmtiles files to Cloudflare R2, you'll need to create a Worker to expose saidfile to the public. Protomaps provides instructions on how to do this with both the web console andthrough Wrangler. At the time of writing this, the instructions for the web console no longer matchthe UI on Cloudflare. For this reason, and for further CORS setup, I'd recommend setting up yourWorker with Wrangler,per the instructions.Your wrangler.toml already comes with an ALLOWED_ORIGINS var, which you can set to enable CORSfor your front-end. As currently set up, however, ALLOWED_ORIGINS only works on exact stringmatches. If you are like the Helium Foundation and would also like to enable CORS for

Add Comment