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

    Ceru ©

    01/26/2021, 2:08 AM
    wanted to connect to a Mongo server from within a Worker
  • c

    Ceru ©

    01/26/2021, 2:09 AM
    looks like i gotta make a HTTP interface for it, whee
  • s

    steranevdy

    01/26/2021, 4:25 AM
    how is cloudflare pages different than cloudflare sites?
  • a

    ai

    01/26/2021, 4:40 AM
    Workers Sites is just a wrangler feature that uploads files in a specific way. Pages is a build pipeline effectively on top of that. More streamlined basically for jam stack.
  • s

    steranevdy

    01/26/2021, 5:00 AM
    is it possible to have both workers sites and workers handling API within the same domain?
  • a

    ai

    01/26/2021, 5:03 AM
    If your API is on a specific path or subdomain, you can configure the Worker routes so the API Worker is on the API path and the Worker Site is on all other paths.
  • a

    ai

    01/26/2021, 5:04 AM
    term: routes
  • c

    Cloudflare Workers Bot

    01/26/2021, 5:04 AM
    message has been deleted
  • a

    ai

    01/26/2021, 5:04 AM
    Good bot
  • l

    Like

    01/26/2021, 12:40 PM
    kom allemaal info over
  • u

    617a7a

    01/26/2021, 2:38 PM
    i'm getting a 523 error when trying to run my worker (ss attached)
  • u

    617a7a

    01/26/2021, 2:39 PM
  • u

    617a7a

    01/26/2021, 2:41 PM
    this was ran by
    Copy code
    bash
    wrangler dev
  • u

    617a7a

    01/26/2021, 2:41 PM
    i also am having a similar error with the worker playground
  • g

    Greg Brimble | Cloudflare Pages

    01/26/2021, 2:42 PM
    cloudflareworkers.com seems to be working for me: https://cloudflareworkers.com/#12a9195720fe4ed660949efdbd9c0219:https://tutorial.cloudflareworkers.com
  • g

    Greg Brimble | Cloudflare Pages

    01/26/2021, 2:43 PM
    Is that what you meant by "worker playground"?
  • u

    617a7a

    01/26/2021, 2:44 PM
    indeed, hm. give me a sec
  • u

    617a7a

    01/26/2021, 2:53 PM
    weird, i reinstalled my modules with npm and now works :/
  • u

    617a7a

    01/26/2021, 3:07 PM
    can you have multiple workers in a single project?
  • g

    Greg Brimble | Cloudflare Pages

    01/26/2021, 3:07 PM
    What are you defining as a project?
  • u

    617a7a

    01/26/2021, 3:09 PM
    A directory with its wrangler.toml
  • u

    617a7a

    01/26/2021, 3:10 PM
    can i have multiple scripts in that directory?
  • g

    Greg Brimble | Cloudflare Pages

    01/26/2021, 3:16 PM
    Technically, yes. You could have
    wrangler.1.config
    and
    wrangler.2.config
    and do
    wrangler publish -c wrangler.1.config
    and
    wrangler publish -c wrangler.2.config
    for the two scripts. It's not an ideal dev experience though, imo, and you'd be much better off with a monorepo.
  • u

    617a7a

    01/26/2021, 3:17 PM
    what would a repo with multiple scripts look like?
  • g

    Greg Brimble | Cloudflare Pages

    01/26/2021, 3:18 PM
    Excuse the hand-made directory structure:
    Copy code
    root/
    |
    |- packages/
      |- project1/
        |- wrangler.toml
        |- src/
      |- project2/
        |- wrangler.toml
        |- src/
  • g

    Greg Brimble | Cloudflare Pages

    01/26/2021, 3:19 PM
    You can use tools like Lerna (https://lerna.js.org/) to help manage to subprojects.
  • g

    Greg Brimble | Cloudflare Pages

    01/26/2021, 3:20 PM
    So you could quite easily setup a command in the root directory to publish all the subprojects e.g.
    lerna run publish
    where each project has an npm script, publish:
    wrangler publish
    .
  • u

    617a7a

    01/26/2021, 3:20 PM
    ahh... i see
  • u

    617a7a

    01/26/2021, 3:20 PM
    awesome, ty
  • g

    Greg Brimble | Cloudflare Pages

    01/26/2021, 3:20 PM
    No worries!
1...707172...2509Latest