Giter VIP home page Giter VIP logo

Comments (7)

threepointone avatar threepointone commented on June 15, 2024

via @Electroid, just run wrangler dev instead. good idea!

from workers-sdk.

petebacondarwin avatar petebacondarwin commented on June 15, 2024
  • For working/developing a Worker (without officially publishing it) then wrangler dev definitely seems like the obvious alternative to preview.
  • Is there an additional use-case where a developer wants to share a draft Worker with a colleague or client without officially publishing it?
    • Does that even make sense?
    • Could we make use of environments instead?

from workers-sdk.

Electroid avatar Electroid commented on June 15, 2024

I think we would want to leverage environments for sharing a preview. It's something we should definitely support with dev. It might need some API work though, because if we publish to a workers.dev subdomain, I think we loose access to the DevTools inspector. (There's no technical limitation here, we just need to implement it in the back)

from workers-sdk.

GregBrimble avatar GregBrimble commented on June 15, 2024

I use it in Discord sometimes when I want to show someone a quick script (e.g. "how do I add a header to a response?"). For simple questions, cloudflareworkers.com is pretty handy. But, I've never used wrangler to use it.

If it's complex enough to require wrangler (e.g. it needs a KV binding or similar), then it's roughly complex enough to require a repo.

from workers-sdk.

TrySound avatar TrySound commented on June 15, 2024

We do some domain parsing in our workers and it's really easy to check things with wrangler preview. With wrangler dev we have only localhost.

from workers-sdk.

petebacondarwin avatar petebacondarwin commented on June 15, 2024

@TrySound - would the --host flag in wrangler dev help you here?
For example if I go to the examples/worker-app project in our repository and run the following
(assuming that I have attached the my-zone.com to my account):

$ npx wrangler dev --host=www.my-zone.com

Then when I browse to http://localhost:8787/foo/bar I see the following in the dev-tools:

GET
"https://www.my-zone.com/foo/bar"
Map(22) {
  [[Entries]]: {
    ...
    { "host": "www.my-zone.com" }
    ...
  }
}

from workers-sdk.

TrySound avatar TrySound commented on June 15, 2024

Thanks, this is very helpful!

from workers-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.