-
Notifications
You must be signed in to change notification settings - Fork 735
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for publishing to Custom domains (#982)
* Support "custom_domain" boolean in toml Needed to re-write a "renderer" of the route to be logged out to the user, but it's now supported in the type system * Publish Custom Domains via /domains api If a toml provides routes with the "custom_domain" flag, publish those separately from normal routes, using the /domains api. As these are more complex than simple routes, we ask the api to error eagerly. If it errors on a conflict for existing custom domains or managed DNS records, we prompt for confirmation to override the conflicts, and then retry with updated parameters * Add tests for publishing to Custom Domains * Add changeset
- Loading branch information
1 parent
cc6e18b
commit 6791703
Showing
6 changed files
with
501 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
"wrangler": minor | ||
--- | ||
|
||
feature: add support for publishing to Custom Domains | ||
|
||
With the release of Custom Domains for workers, users can publish directly to a custom domain on a route, rather than creating a dummy DNS record first and manually pointing the worker over - this adds the same support to wrangler. | ||
|
||
Users declare routes as normal, but to indicate that a route should be treated as a custom domain, a user simply uses the object format in the toml file, but with a new key: custom_domain (i.e. `routes = [{ pattern = "api.example.com", custom_domain = true }]`) | ||
|
||
When wrangler sees a route like this, it peels them off from the rest of the routes and publishes them separately, using the /domains api. This api is very defensive, erroring eagerly if there are conflicts in existing Custom Domains or managed DNS records. In the case of conflicts, wrangler prompts for confirmation, and then retries with parameters to indicate overriding is allowed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.