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

    ___Tristan___

    01/19/2021, 11:06 PM
    Hey guys, has anyone here tried deploying Cython code on a worker?
  • n

    naveed

    01/19/2021, 11:13 PM
    trying to get my hands on workers... A question.. Does workers further processed by cloudflare functions eg. I am using custom html in workers including javascript code, will it further processed with RocketLoader and minify the code? or do we need to specifically enable it? I see using runtime api but can't see RocketLoader.
  • n

    naveed

    01/19/2021, 11:47 PM
    Copy code
    const html = '<!DOCTYPE html><body><p>testing@testingg.com</p></body>'
    
    async function handleRequest(request) {
        return new Response(html,{
            headers: {
                "content-type": "text/html;charset=UTF-8",
            },
        })
    }
    addEventListener("fetch", event => {
        let newreq = new Request(fetch(event.request, {cf:{scrapeShield:true}}))
        return event.respondWith(handleRequest(newreq))
    })
  • n

    naveed

    01/19/2021, 11:48 PM
    what's the right way to pass CF function in request?
  • g

    Greg Brimble | Cloudflare Pages

    01/19/2021, 11:49 PM
    I'm pretty certain that if you're using Workers, Rocket Loader isn't injected into your page.
  • r

    rita

    01/20/2021, 1:34 AM
    https://twitter.com/dinasaur_404/status/1351703331744321536?s=21 i’m pretty sure a few folks here have asked about self-serve ssl for saas in the past
  • k

    kristian

    01/20/2021, 1:59 AM
    @rita me me me 🙂
  • s

    steranevdy

    01/20/2021, 4:21 AM
    is there doc on how to use node modules with cloudflare workers
  • a

    albert-zhao

    01/20/2021, 5:16 AM
    Workers cannot run Node at this time - though it's something the team is looking at support for this year 🙂
  • s

    steranevdy

    01/20/2021, 5:18 AM
    Can you use npm modules?
  • a

    albert-zhao

    01/20/2021, 5:20 AM
    Yes!
  • s

    steranevdy

    01/20/2021, 5:28 AM
    Is there a way to connect to mongodb from workers?
  • a

    albert-zhao

    01/20/2021, 5:32 AM
    Not at the moment, though we're working on a tutorial about connecting to MongoDB through their Realm SDK. Not sure when it'll come out
  • m

    macedonian

    01/20/2021, 8:17 AM
    Can you still see top bots and crawlers in the Analytics part of the Cloudflare dashboard when using Workers as your origin?
  • i

    itsmatteomanf

    01/20/2021, 10:10 AM
    That part shouldn't change.
  • m

    macedonian

    01/20/2021, 10:10 AM
    Ok, perhaps it’ll need more time before seeing data there.
  • m

    macedonian

    01/20/2021, 10:11 AM
    I’ll keep an eye one it, thanks.
  • j

    jordan

    01/20/2021, 11:25 AM
    has anyone played around with creating "animated gifs on the edge"? very specifically, i'm wondering how to cram a couple useful npm modules into a worker.
    canvas
    +
    gifencoder
    allow me to create anumated gifs in node, exactly how i'd like.
  • j

    jordan

    01/20/2021, 11:25 AM
    but it's expensive on the server.. i'm wondering if this is a good potential use case for workers
  • j

    jordan

    01/20/2021, 11:26 AM
    and my first attemps a couple months ago were failed: iirc i wasn't able to get those npm modules bundled or working right as a worker.
  • g

    Greg Brimble | Cloudflare Pages

    01/20/2021, 11:28 AM
    @User made this last year: https://whattimeisitrightnow.fab.dev/
  • g

    Greg Brimble | Cloudflare Pages

    01/20/2021, 11:34 AM
    Not sure if he published the code anywhere though. But he did say: "i'm pulling a TTF file from KV store, parsing it using opentype.js, then using pureimage to give me a canvas-like API, then using gif-encoder to render the frame the same FAB is deployed twice to try to get more frames under the CPU budget, one of them renders each frame and the other just snips the binary streams together then waits"
  • j

    jordan

    01/20/2021, 11:35 AM
    😮
  • j

    jordan

    01/20/2021, 11:36 AM
    ahh ok - i'll take another crack at my idea. it's definitely possible! thanks!
  • g

    Greg Brimble | Cloudflare Pages

    01/20/2021, 11:37 AM
    Possible, but resource-intensive. So be wary of hitting limits 🙂
  • g

    geelen

    01/20/2021, 11:54 AM
    oh yeah i'm still waiting for access to Unbound to polish off that demo :)
  • g

    geelen

    01/20/2021, 11:55 AM
    right now I'm considering a rust-based drawing library like https://docs.rs/plotters/0.3.0/plotters/ compiled to WASM to get more complex drawings in shorter time
  • g

    geelen

    01/20/2021, 11:55 AM
    but i haven't had a crack at that properly yet
  • j

    jordan

    01/20/2021, 12:09 PM
    i gotta hang in this discord more.
  • j

    jordan

    01/20/2021, 12:09 PM
    😄
1...626364...2509Latest