Repository navigation
Docs: running the snippet locally with Wrangler - #69
Merged
Merged
Conversation
Describe how wrangler dev can run cf_ctreq.min.js in front of a real log (--local-upstream, with --upstream-protocol https), and that it doesn't enforce the limits that only apply to Snippets, such as error 1201. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a "Running the snippet locally" subsection under Testing (and to the contents), describing how to run
cf_ctreq.min.jswithnpx wrangler dev, in front of a real log:It notes that the snippet sees the log's hostname (so
CONFIG.logEnvironmentsapplies as deployed), but that Wrangler runs it as a Worker, so the limits specific to Snippets (CPU time, and error 1201) aren't enforced; that forwarded requests are real submissions; and that.wrangler/is ignored by Git.Validation
With Wrangler 4.162.0 (no Cloudflare login needed), against Tiger2027h1 (where CF_CTreq is disabled):
invalid-jsonrejection;OPTIONS: 405 (Tiger'strillianenvironment);get-sth: passed through.--upstream-protocol httpsis needed: without it, forwarded requests went to the log over plain HTTP and got a 301.