Skip to content

Commit

Permalink
Add deployment instructions for Cloudflare Worker
Browse files Browse the repository at this point in the history
  • Loading branch information
jake-low committed Jan 22, 2025
1 parent d16ee1b commit 94e1f90
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cloudflare/README.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 94e1f90

Please sign in to comment.