Skip to content

digital-identity-platform-docs


digital-identity-platform-docs / workers/sgtm-router/worker / default

Variable: default

default: object

Defined in: workers/sgtm-router/worker.js:1700

Main Router Worker Entry Point.

Type Declaration

fetch()

fetch(request, env, ctx): Promise<Response>

Parameters

request

any

env

any

ctx

any

Returns

Promise<Response>

Remarks

Orchestrates the entire request lifecycle:

  1. CORS Preflight: Handles OPTIONS requests immediately.
  2. Config Resolution: Fetches ROUTING_MAP and EDGE_CONFIG.
  3. Validation: Enforces allowed_hosts and Billing Status (paused).
  4. Routing:
    • /k/...: Decodes obfuscated proxy paths.
    • /ccm/collect: Validates against external allowlist.
    • *: Standard proxy to origin.
  5. Observability: Logs to Analytics Engine + R2 via ctx.waitUntil.

Param

Incoming HTTP request.

Param

Worker environment bindings.

Param

Cloudflare execution context.

Returns

The final HTTP response.

Released under proprietary license.