Skip to content

feat: localhost subdomain routing#12550

Draft
edmundhung wants to merge 3 commits intomainfrom
edmundhung/expose-entrypoints
Draft

feat: localhost subdomain routing#12550
edmundhung wants to merge 3 commits intomainfrom
edmundhung/expose-entrypoints

Conversation

@edmundhung
Copy link
Member

@edmundhung edmundhung commented Feb 12, 2026

Fixes n/a.

This adds the ability to access worker entrypoints directly via localhost subdomains during local development. In multi-worker setups, each worker and its entrypoints get their own subdomain URLs:

  • http://{worker}.localhost:{port}: routes to the worker's default entrypoint
  • http://{entrypoint}.{worker}.localhost:{port}: routes to a specific entrypoint

This is opt-in per worker. Set true to expose all entrypoints using their export names as aliases, or use an object to pick specific entrypoints and customize their aliases.

Not all systems resolve *.localhost subdomains. A DNS check will run on startup and warns if the system doesn't support it. Browsers (Chrome, Edge, Firefox) resolve these independently and will always work. Non-browser tools like curl might not resolve on some systems.

Wrangler

Add dev.expose_entrypoints to each worker config:

// dashboard/wrangler.json
{
    "name": "dashboard",
    "dev": {
        // e.g. http://dashboard.localhost:8787/ -> default entrypoint
        "expose_entrypoints": true,
    },
}
// admin/wrangler.json
{
    "name": "admin",
    "dev": {
        "expose_entrypoints": {
            "default": true, // http://admin.localhost:8787
            "ApiEntrypoint": "api", // http://api.admin.localhost:8787
        },
    },
}
wrangler dev -c dashboard/wrangler.json -c admin/wrangler.json

Vite plugin

Set exposeEntrypoints in the plugin config:

cloudflare({
    configPath: "./dashboard/wrangler.json",
    // Expose all entrypoints using their export names as aliases
    // e.g. http://dashboard.localhost:8787/ -> default entrypoint
    exposeEntrypoints: true,
    auxiliaryWorkers: [
        {
            configPath: "./admin/wrangler.json",
            // Or use an object to pick specific entrypoints and customize aliases
            exposeEntrypoints: {
                default: true, // http://admin.localhost:8787
                ApiEntrypoint: "api", // http://api.admin.localhost:8787
            },
        },
    ],
});

  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because:

A picture of a cute animal (not mandatory, but encouraged)

@changeset-bot
Copy link

changeset-bot bot commented Feb 12, 2026

🦋 Changeset detected

Latest commit: 29a1af8

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 12, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@12550

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@12550

miniflare

npm i https://pkg.pr.new/miniflare@12550

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@12550

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@12550

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@12550

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@12550

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@12550

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@12550

wrangler

npm i https://pkg.pr.new/wrangler@12550

commit: 29a1af8

@edmundhung edmundhung changed the title feat: entrypoint routing for local dev feat: localhost entrypoint routing Feb 12, 2026
@edmundhung edmundhung force-pushed the edmundhung/expose-entrypoints branch 3 times, most recently from 176f07d to b908949 Compare February 16, 2026 13:02
@edmundhung edmundhung changed the title feat: localhost entrypoint routing feat: localhost subdomain routing Feb 16, 2026
@edmundhung edmundhung force-pushed the edmundhung/expose-entrypoints branch from b908949 to d1e0761 Compare February 16, 2026 13:35
@claude
Copy link
Contributor

claude bot commented Feb 16, 2026

Claude finished @edmundhung's task —— View job


Changeset Review

  • Read changeset guidelines
  • Review changeset files
  • Check for cute animals
  • Provide feedback

All changesets look good

All three changeset files follow the guidelines correctly:

  • Version type: All correctly marked as minor (new configuration options/features)
  • Changelog quality: Clear descriptions with helpful usage examples
  • Markdown headers: No h1/h2/h3 headers used
  • Format: Proper structure with concise titles and informative bodies
  • Examples: Good use of code examples showing how to use the new features

The changesets appropriately document the new localhost subdomain routing feature across all three packages (miniflare, vite-plugin, and wrangler).


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

1 participant

Comments