Skip to content

Commit c4ad144

Browse files
authored
Update Cloudflare instructions with new way to assign subdomain [#3] (#26)
1 parent 53a1926 commit c4ad144

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

deploy/cloudflare.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,11 @@ Make a request for `<ACCOUNT_NAME>.workers.dev/<FILENAME>/0/0/0.<mvt | png>` to
6161

6262
For the cache to work, the worker must be assigned a zone on your own domain, not `workers.dev`.
6363

64-
1. In Websites > your domain > DNS, Add a CNAME entry pointing to your `workers.dev` domain:
64+
1. In **Triggers** for your Worker, **Add Custom Domain** e.g. `subdomain.mydomain.com`. This will create a DNS entry in your Cloudflare site.
6565

66-
![cloudflare image](./cloudflare_1.png)
66+
2. In **Routes**, Assign the route `subdomain.mydomain.com/*` to your worker. This directs traffic to the above subdomain to this specific worker.
6767

68-
2. In Websites > your domain > Workers Routes, Choose **Add Route**.
69-
70-
* for **Route**, enter `SUBDOMAIN.mydomain.com/*`
71-
72-
* for **Service**, choose the name of your Worker. for **Environment**, choose `production`.
73-
74-
![cloudflare image](./cloudflare_2.png)
75-
76-
Verify your deployment is working on `SUBDOMAIN.mydomain.com` by checking for the `Cf-Cache-Status` header with a value of `HIT` on tile requests. This may take 2-3 attempts.
68+
Verify your deployment is working by checking for the `Cf-Cache-Status` header with a value of `HIT` on tile requests. This may take 2-3 attempts.
7769

7870
Example with `curl` for vector tiles and [TileJSON](https://github.com/mapbox/tilejson-spec):
7971

deploy/cloudflare_1.png

-39.8 KB
Binary file not shown.

deploy/cloudflare_2.png

-38.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)