From 94e1f90b50449e918c2c3ff26132a8b47dc18f24 Mon Sep 17 00:00:00 2001 From: Jake Low Date: Tue, 21 Jan 2025 17:56:26 -0800 Subject: [PATCH] Add deployment instructions for Cloudflare Worker --- cloudflare/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cloudflare/README.md b/cloudflare/README.md index 12219ed..8ff6f51 100644 --- a/cloudflare/README.md +++ b/cloudflare/README.md @@ -1,3 +1,7 @@ This is the code for the [Cloudflare Worker](https://developers.cloudflare.com/workers/) that serves tile requests at tiles.openstreetmap.us. The tile data is uploaded as a PMTiles file to a [Cloudflare R2](https://developers.cloudflare.com/r2/) bucket. The worker's job is to handle HTTP requests for tiles by Z/X/Y ID, retrieve the data for that tile from the PMTiles archive, and return it to the client. It also serves TileJSON to describe each tileset, and enforces per-IP and per-Origin rate limits. The worker code is adapted from [example code in from the PMTiles project](https://github.com/protomaps/PMTiles/tree/main/serverless/cloudflare). See the LICENSE file for details. + +## Deploying + +To deploy this code, run `npm run deploy`. This uses Cloudflare's "Wrangler" CLI tool to build and upload the code. You can also use the Wrangler CLI to test the worker locally.