Files
PMTiles/serverless/cloudflare
Brandon Liu 95b1f90a04 Revert "cloudflare worker: cache holds promises instead of buffers"
see errors related to "The script will never generate a response."

This reverts commit e0402ded7f.
2022-07-21 10:23:13 +08:00
..
2022-07-20 16:38:36 +08:00
2022-07-20 14:49:34 +08:00
2022-07-20 16:38:36 +08:00

PMTiles on Cloudflare Workers

Use rclone to upload your PMTiles archives to an R2 bucket. The Web UI is limited to 300 MB.

Getting started

  • Generate worker.js with all dependencies bundled:
git clone https://github.com/protomaps/PMTiles
cd serverless/cloudflare
npm run build

Copy dist/worker.js into the Cloudflare Workers editor.

  • In Settings > Variables, bind your bucket to the environment variable BUCKET.

By default, your worker will serve tiles at path NAME/0/0/0.pbf using the archive at the root of your bucket NAME.pmtiles.

This behavior can be customized with two optional environment variables:

PMTILES_PATH TILE_PATH

(TODO)