https://discord.cloudflare.com logo
Join Discord
Powered by
# workers-discussions
  • d

    dave

    05/17/2023, 8:07 PM
    lol you're always doing something that I'm about to do in a week or two
  • s

    sathoro

    05/17/2023, 8:07 PM
    I used R2 instead
  • d

    dave

    05/17/2023, 8:07 PM
    ...lol, about what I was gonna suggest
  • s

    sathoro

    05/17/2023, 8:08 PM
    yeah its already in prod 🤣
  • d

    dave

    05/17/2023, 8:08 PM
    hmm, wrangler tail is super flaky right now
  • d

    dave

    05/17/2023, 8:09 PM
    that's the Worker way: faster to make your own API fixes than asking the endpoint provider 😛
  • d

    dave

    05/17/2023, 8:11 PM
    If I have a Worker listening on https://www.example.com/sathoro, will Zaraz automatically trigger a page view event still?
  • d

    dave

    05/17/2023, 8:11 PM
    or do I have to use the HTTP API endpoint manually?
  • d

    Dorian

    05/17/2023, 8:53 PM
    Worker "Quick Edit" not working.
  • u

    Unsmart | Tech debt

    05/17/2023, 8:55 PM
    what about it is not working?
  • d

    Dorian

    05/17/2023, 8:57 PM
    Problem opening the code editor. I can't see or edit the worker code. I've cleared cache and cookies, but that doesn't help.
  • d

    Dorian

    05/17/2023, 8:58 PM
    My colleague has a similar problem.
  • s

    spence

    05/17/2023, 9:16 PM
    Is it normal to see this after a pages deployment, but it never starts working?

    https://cdn.discordapp.com/attachments/779390076219686943/1108503437349507172/Screenshot_2023-05-17_at_11.16.15_PM.pngâ–¾

  • w

    Walshy | Pages

    05/17/2023, 9:18 PM
    #895794943182909470
  • w

    Walshy | Pages

    05/17/2023, 9:18 PM
    There's some lag deploying
  • s

    spence

    05/17/2023, 9:18 PM
    Okk, thanks for the info
  • n

    nora

    05/17/2023, 9:26 PM
    yes you can. you were probably looking at direct upload urls, which is a easier way to allow clients to upload directly to your images
  • n

    nora

    05/17/2023, 9:29 PM
    also the docs seem to be a bit lacking initially. but the way to go is a combination of the example shown @ https://developers.cloudflare.com/images/cloudflare-images/upload-images/direct-creator-upload/ and https://developers.cloudflare.com/images/cloudflare-images/upload-images/upload-via-url/
  • n

    nora

    05/17/2023, 9:29 PM
    except for instead of
    --form 'url='
    , you use the
    --form 'file='
    example
  • n

    nora

    05/17/2023, 9:34 PM
    and for the sake of it, I had to spend quite some time to get a working base64 png upload controller for workers:
    Copy code
    js
    export async function uploadImage(name: string, base64Image: string, url: string) {
        const mimeType = "image/png";
        
        const buffer = Buffer.from(base64Image.split(';base64,')[1], 'base64');
        const uint8Array = new Uint8Array(buffer);
        const blob = new Blob([ uint8Array ], { type: mimeType });
    
        const body = new FormData();
    
        body.append("file", blob, name);
    
        const response = await fetch(url, {
            method: "POST",
            body
        });
    
        const content = await response.json();
    
        return content;
    };
  • l

    lgraz

    05/17/2023, 9:40 PM
    With the new updates to the quick edit feature is there a way to automatically push changes to a remote repo?
  • d

    dave

    05/17/2023, 10:58 PM
    Copy code
    [placement.production]
    mode = "smart"
    Copy code
    ✘ [ERROR] Processing wrangler.toml configuration:
    
        - "placement.mode" is a required field.
  • d

    dave

    05/17/2023, 10:58 PM
    what am I doing wrong?
  • d

    dave

    05/17/2023, 10:59 PM
    IMO you probably want R2 anyway to store the original image for a bit.
  • u

    Unsmart | Tech debt

    05/17/2023, 10:59 PM
    Copy code
    [placement]
    mode = "smart"
  • d

    dave

    05/17/2023, 10:59 PM
    I can't do it per env?
  • u

    Unsmart | Tech debt

    05/17/2023, 10:59 PM
    Copy code
    [env.production.placement]
    mode = "smart"
  • d

    dave

    05/17/2023, 10:59 PM
    derp
  • s

    Shayan

    05/17/2023, 11:09 PM
    Hey folks! I'm trying to add a new route to my worker but it's been giving me
    not found / 404
    for the past hour or so.
  • s

    Shayan

    05/17/2023, 11:10 PM
    everything works fine locally and the previous routes are also fine, but for whatever reason it is, it's not finding the new route
1...247324742475...2509Latest