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

    kian

    04/14/2023, 6:52 AM
    That issue is more for Worker Worker so there might be another bug for your Worker Proxied Origin scenario
  • j

    johannes

    04/14/2023, 6:54 AM
    Thank you, I'll do that!
  • Using Streams · Cloudflare Workers docs
    h

    hugh

    04/14/2023, 8:22 AM
    Hi gang! I've started my first bit of work with CloudFlare workers this week and I'm really impressed! They're really fun to work with! I'm trying to build a worker to stream a response from OpenAI to my web app, but OpenAI responds with some pretty funky data format so I need to do some data transformations first. However, I couldn't quite get it working - it looked to me like the transform function of my TransformStream wasn't being called (I put in a console.log for good measure and never saw it in the output). I found a bit of some potentially conflicting information in your docs so just wanted to ask: is it possible for me to stream data from one resource to the client through a worker whilst carrying out some transforms on it? This link suggests I should use streams to modify my response body: https://developers.cloudflare.com/workers/learning/using-streams/ But this one says that workers currently only impement identity transform streams, which don't support modifying data as it's streamed through: https://developers.cloudflare.com/workers/runtime-apis/streams/transformstream/ Thanks in advance for your help!
    k
    • 2
    • 3
  • x

    xnslx

    04/14/2023, 1:32 PM
    Question. I finally deploy Shopify hydrogen V2(built based on Remix) to Cloudflare workers, but it kinda of losing all the css styling. Does anyone encounter the same issue and how to resolve it? Many thanks!
  • p

    plutoniumm

    04/14/2023, 5:45 PM
    hey so idk if this is the right place for it please redirect me to the appropriate person if needed. I noticed the WASM Runtime is public under the
    workerd
    package on NPM. I happen to hold the
    workered
    (with the 'e') package name but its not doing much and I don't need it. So I can release it if Cloudflare can put that to better use?
  • p

    plutoniumm

    04/14/2023, 5:46 PM
    Asking so that if you need it and I do it on the wrong time someone else would probably take it up lol
  • k

    kian

    04/14/2023, 5:51 PM
    Cloudflare doesn’t hold a trademark for workerd but I can see how that package name could be used maliciously for typos - cc @Vero 🐙 who can get the message to the right people
  • u

    [AEP] Funcracker

    04/14/2023, 6:20 PM
    Good day folks! I have a scheduled worker to fetch some info, process it and store it. I have another worker that is available through an endpoint (fetched by our website) and that uses that piece of info that was stored in storage. I was trying to do this by Caching this piece of info (a number, I kid you not). But I am unsure if that works. I do have to wrap the number into a Response object, in order to push it in the Cache, but that is fine of course. They cache key is not an actual valid URL, but just a constant used by both Workers. Is this the best way? I am looking to minimize costs (of course), but also, such a tiny piece of info seems best stored in something like a Cache.
  • j

    James

    04/14/2023, 6:34 PM
    Functionally that code will work, but you won't really get the benefit of cache when you're combining scheduled workers + real traffic.
    cache
    is datacenter specific, and scheduled workers run in a subset of datacenters, so if you get traffic in a datacenter that your schedule didn't run in, it won't have a cache. And if that only runs once per hour for example, it's only cached in 1 location. Your better option here would probably be to store the info to KV on that schedule instead - that provides much more of a guarantee, and will be quick to retrieve.
  • u

    [AEP] Funcracker

    04/14/2023, 6:39 PM
    Thanks for that insight!
  • u

    0xstdsp

    04/14/2023, 7:37 PM
    What's the best way to create a worker which streams a folder? My use case is an endpoint which serves the exact same output as a git clone would
  • w

    Wichard

    04/14/2023, 8:07 PM
    Hello?
  • w

    Wichard

    04/14/2023, 8:08 PM
    Maybe a worker can only connect to wss but not ws ??
  • p

    paninizer

    04/14/2023, 9:49 PM
    Hi all. I have a question. So if I were to run Node.js with Express.js to route, Express-Sessions for cookies, Mongoose to connect to MongoDB, passport and passport-discord for authentication Will my scripts exceed the maximum limit of 1MB on the free tier? If you want to see my source code please ping me.
  • p

    paninizer

    04/14/2023, 9:52 PM
    (I only have like 5 JS files except packages that are pretty much barebones)
  • c

    Cyb3r-Jok3

    04/14/2023, 9:52 PM
    You can't run express.js on workers. Workers uses the V8 run time not Node JS
  • p

    paninizer

    04/14/2023, 9:53 PM
    Ah... Yea that's a problem... Welp thanks mate
  • p

    paninizer

    04/14/2023, 9:54 PM
    Would you suggest any other free hosting for what I have? If not I'll just have to buy a raspberry pi
  • t

    Tom Sherman

    04/14/2023, 9:57 PM
    sounds like you're trying to build a discord bot? you can definitely deploy that to workers: https://discord.com/developers/docs/tutorials/hosting-on-cloudflare-workers
  • c

    Cyb3r-Jok3

    04/14/2023, 9:58 PM
    railway or fly.io are going to be your best bets
  • p

    paninizer

    04/14/2023, 9:59 PM
    It's not a discord bot, rather the authentication backend for my discord bot's website. Currently using replit rn but replit is notorious for being horrible (and its DNS fries every 3 hours so I can't connect to my MongoDB to store cookies)
  • p

    paninizer

    04/14/2023, 9:59 PM
    Aight I'll check them out I appreciate your help
  • t

    Tom Sherman

    04/14/2023, 10:00 PM
    you can build that on workers too 😄
  • t

    Tom Sherman

    04/14/2023, 10:00 PM
    you just won't be able to use those node.js libraries you mentioned
  • p

    paninizer

    04/14/2023, 10:01 PM
    Yea that will prove to be a bit of a hassle (and since I don't know how to code backend-frontend authentication integrations I'll have to rely on libraries)
  • t

    Tom Sherman

    04/14/2023, 10:02 PM
    you can use this instead of passport on workers: https://github.com/subhendukundu/worker-auth-providers
  • p

    paninizer

    04/14/2023, 10:08 PM
    I'll prob have to wait to get a raspberry pi And then buy a domain because I've never navigated this before (and I'm pretty sure I will screw up in a grand scale) but anyways thank you all
  • t

    Tom Sherman

    04/14/2023, 10:17 PM
    and then find a way to expose that raspberry pi to the internet
  • p

    paninizer

    04/14/2023, 10:17 PM
    Yup
  • p

    paninizer

    04/14/2023, 10:17 PM
    I'll figure it out
1...239423952396...2509Latest