22 Matching Annotations
  1. Oct 2023
    1. While the interface among services is HTTP, the networking is not. In fact, there is no networking! Unlike the typical “microservice architecture,” where services communicate over a network and can suffer from latency or interruption, service bindings are a zero-cost abstraction. When you deploy a service, we build a dependency graph of its service bindings, then package all of those services into a single deployment. When one service invokes another, there is no network delay; the request is executed immediately.This zero-cost model enables teams to share and reuse code within their organizations, without sacrificing latency or performance.
  2. Aug 2023
    1. ```toml type = "webpack" webpack_config = "webpack.config.js"

      these will be used in production

      vars = { WORKER_ENV = "production", SENTRY_ENABLED = true }

      [env.local]

      these will be used only when --env=local

      vars = { WORKER_ENV = "local", SENTRY_ENABLED = false } ```

      wrangler dev --env=local

    1. ```js // Auth Worker

      export default { async fetch(request, env) { // Read x-custom-token header and make sure it matches SECRET_TOKEN if (request.headers.get('x-custom-token') === env.SECRET_TOKEN) { return new Response('Request allowed', { status: 200 }); } else { return new Response('x-custom-token does not match, request not allowed', { status: 403 }); } }, }; ```

      ```js // Gateway Worker

      export default { async fetch(request, env) { // Fetch AUTH service and pass request const authResponse = await env.auth.fetch(request.clone());

      // Return response from the AUTH service if the response status is not 200
      // It would return 403 'x-custom-token does not match, request not allowed' response in such case
      if (authResponse.status !== 200) {
        return authResponse;
      }
      
      // Request allowed
      // You can write application logic here
      // In this case we delegate the logic to an `application` Worker
      return await env.application.fetch(request)
      

      }, }; ```

  3. Jul 2023
  4. Jun 2023
  5. May 2023
    1. Hey! Thanks for raising this. As pointed out earlier in the thread, the workerd npm distribution is currently incompatible with Debian 11 "Bullseye", so won't work with any distro based off that (e.g. Ubuntu 20.04). Debian 12 "Bookworm" based distros (e.g. Ubuntu 22.04) should work, provided you apt install libc++1. We're working on getting a statically linked version of workerd published that should work on older Linux versions. No timeline on when this will be available though.
  6. Feb 2023
  7. Nov 2022
  8. Sep 2022
  9. Mar 2022