question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

wrangler.toml -- support for 'type = "disabled"'

See original GitHub issue

šŸ’” Feature request

Support for workers which, when configured and ā€œpublishedā€ via wrangler, appear as ā€œDisabledā€ in the UI.

image

Overview and problem statement

I would like to include additional configuration for workers which operate on routes that have a very broad scope, such as mysite.com/api/* to manage specific routes which I know do not need to invoke not just the current worker, but any worker, in order to reduce unnecessary worker invocations.

Basic example

Currently, I must do this manually, or automate it via some light scripting. Although itā€™s not that bad to manage this via the API, itā€™d be much nicer to get this type of feature in front of users so that it can reduce worker invocations.

It would be great to set this in my wrangler.toml file somehow, perhaps as an ā€œenvironmentā€.

wrangler.toml

type = "webpack"
account_id = "..."
zone_id = "..."
name = "all-i-want-for-christmas-is-fetch-event-bubbling"
route = "mysite.com/api/*"

[env.disabled]
type = "disabled"
routes = ["mysite.com/api/.well-known/jwks", "mysite.com/api/customers/thatoneguy/*", "mysite.com/api/externalthing/*" ]
$: wrangler publish -e disabled

Or however you want to do it. The important part is that this information about disabled routes is contained next to the rest of my workerā€™s source code. The bits where workers arenā€™t running is just as important as where they do run!

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:6
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

10reactions
ObsidianMinorcommented, Jan 22, 2021

Perhaps this could be done with a route object, so you could enter an enabled string or an inline table with a disable bool. For example

routes = [
    "mysite.com/api/*",
    { disable = true, route = "mysite.com/api/.well-known/jwks" },
    { disable = true, route = "mysite.com/api/customers/thatoneguy/*" },
    { disable = true, route = "mysite.com/api/externalthing/*" },
]
2reactions
threepointonecommented, Jul 4, 2022

Iā€™ll discuss this internally and weā€™ll get back to this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

wrangler.toml -- support for 'type = "disabled"' #1319 - GitHub
Support for workers which, when configured and "published" via wrangler, appear as "Disabled" in the UI. image. Overview and problem statement.
Read more >
Configuration Ā· Cloudflare Workers docs
Wrangler optionally uses a wrangler.toml configuration file to customize the development and publishing setup for a Worker.
Read more >
Using the CLI - Miniflare
Fun, full-featured, fully-local simulator for Cloudflare Workers.
Read more >
wrangler - crates.io: Rust Package Registry
This command looks at your wrangler.toml file and runs the build steps associated with the "type" declared there.
Read more >
wrangler 1.2.0 - Docs.rs
To disable publishing to your workers.dev subdomain, set `private = true` in ... To use `--release` your `wrangler.toml` must include: - `name` -...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found