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

    nordiauwu

    03/21/2023, 9:34 PM
    In a WASI blog post they were using
    wrangler dev /path/to/.wasm
    which doesn't seem to work anymore. The Rust SDK also does not support wasm32-wasi. I'll try the example from the repo you sent.
  • e

    Erisa | Support Engineer

    03/21/2023, 9:36 PM
    The blogs arent always updated when things are changed, so yeah id recommend the github repo as the source of truth
  • d

    Deleted User

    03/21/2023, 10:29 PM
    how to get worker url from cron event?
  • h

    HardAtWork

    03/21/2023, 10:32 PM
    You can’t, since it wouldn’t have one?
  • d

    Deleted User

    03/21/2023, 10:32 PM
    ic
  • h

    HardAtWork

    03/21/2023, 10:33 PM
    Or well, a Worker with both a fetch handler and a scheduled handler may have a public route it runs on, but that wouldn’t be exposed to you
  • h

    HardAtWork

    03/21/2023, 10:34 PM
    At least not automatically
  • d

    Deleted User

    03/21/2023, 10:34 PM
    this is gonna be finicky to figure out
  • d

    Deleted User

    03/21/2023, 10:38 PM
    nvm that was simple, just check my preexisting kv store
  • k

    Keizer

    03/22/2023, 1:00 AM
    Hey guys I have been banging my head on this all day. If I selected one file (txt file with my template in it) I can load that no problem
  • k

    Keizer

    03/22/2023, 1:00 AM
    When I go to select more than one file from R2 using Workers ES it just gives metadata
  • k

    Keizer

    03/22/2023, 1:00 AM
    Do I have to wrap each on in a fetch(){ } or something?
  • k

    Keizer

    03/22/2023, 1:01 AM
    Basically need to put down five template files from R2 since I can't just include them in the worker. Then I put them in an object to be used by mustache template
  • k

    Keizer

    03/22/2023, 1:02 AM
    Is it possible to do more than one request in R2 and get back the object.body of the five files?
  • k

    Keizer

    03/22/2023, 1:02 AM
    This has been extremely frustrating
  • k

    Keizer

    03/22/2023, 1:03 AM
    Extremely painful experience compared to using Lambda where I can just upload a zip file and run Node.js and everything works as expected
  • k

    Keizer

    03/22/2023, 1:04 AM
    Like fs functions lol
  • k

    Keizer

    03/22/2023, 1:05 AM
    I just want to control the header and footer of my site, it doesn't require a framework to do that... Simple load in a few txt files, parse with mustache and render
  • k

    Keizer

    03/22/2023, 1:10 AM
    There should be a general "Workers" area on the menu on the left. "Workers Routes" doesn't take me to anywhere useful. I have to type in a subdomain and click login (because it doesn't recognize I am already logged in) and it will load proper. Would be nice if there was a link in the menu on the left
  • k

    Keizer

    03/22/2023, 1:10 AM
    I can tell this is brand new and barely works lol
  • c

    Chaika

    03/22/2023, 1:18 AM
    I don't get what you mean by "Select"? "Is it possible to do more than one request in R2 and get back the object.body of the five files?" Sure, just make request to get them. Assuming module worker environment, example:
    Copy code
    js
        var obj1 = await env.R2.get("1");
        var obj2 = await env.R2.get("2");
        return new Response(await obj1.text() + "\n" + await obj2.text() )
  • k

    Keizer

    03/22/2023, 1:19 AM
    omg
  • k

    Keizer

    03/22/2023, 1:19 AM
    .text() must be the problem
  • k

    Keizer

    03/22/2023, 1:19 AM
    The example on the site used .body and that worked
  • k

    Keizer

    03/22/2023, 1:19 AM
    But only for one file
  • k

    Keizer

    03/22/2023, 1:19 AM
    (at a time)
  • c

    Chaika

    03/22/2023, 1:19 AM
    Workers is account level. Just go up one level from your zone (top left) and go to "Workers" there. I assume you're trying to find the worker from searching for the dns record and clicking on it, strange that it would make you relogin
  • k

    Keizer

    03/22/2023, 1:20 AM
    Thanks, I will attempt and try to correct this
  • c

    Chaika

    03/22/2023, 1:20 AM
    I was just using text in my example as I wanted to return both of them. .body returns a ReadableStream for that file In the types / API Reference, R2ObjectBody (which inherits from R2Object) is what is returned by the Get https://developers.cloudflare.com/r2/api/workers/workers-api-reference/#r2objectbody-definition Assuming you are using the readable stream correctly, there shouldn't be any issue getting multiple files and using their body's
  • k

    Keizer

    03/22/2023, 1:29 AM
    omg
1...235123522353...2509Latest