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:
- CORS Preflight: Handles
OPTIONSrequests immediately. - Config Resolution: Fetches
ROUTING_MAPandEDGE_CONFIG. - Validation: Enforces
allowed_hostsand Billing Status (paused). - Routing:
/k/...: Decodes obfuscated proxy paths./ccm/collect: Validates against external allowlist.*: Standard proxy to origin.
- 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.