From e1f469b6f1c064978ce002ca9cb23ffba8f87fb2 Mon Sep 17 00:00:00 2001 From: autocommit Date: Sat, 16 May 2026 18:57:18 -0700 Subject: [PATCH] =?UTF-8?q?feat(beacon):=20=E2=9C=A8=20Implement=20BeaconC?= =?UTF-8?q?ontroller=20with=20HTTP=20endpoints=20and=20BeaconModule=20prov?= =?UTF-8?q?iders=20for=20beacon=20data=20processing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- .../collector/src/beacon/beacon.controller.ts | 44 +++++++++++++++++++ .../collector/src/beacon/beacon.module.ts | 7 +++ 2 files changed, 51 insertions(+) create mode 100644 services/collector/src/beacon/beacon.controller.ts create mode 100644 services/collector/src/beacon/beacon.module.ts diff --git a/services/collector/src/beacon/beacon.controller.ts b/services/collector/src/beacon/beacon.controller.ts new file mode 100644 index 0000000..564c98b --- /dev/null +++ b/services/collector/src/beacon/beacon.controller.ts @@ -0,0 +1,44 @@ +import { readFileSync } from 'node:fs'; +import { fileURLToPath } from 'node:url'; +import { Controller, Get, Header, Logger, NotFoundException, SetMetadata } from '@nestjs/common'; +import { IS_PUBLIC_KEY } from '../auth/write-key.guard'; + +/** + * Serves the static beacon.js script at `/beacon.js` (carved out of the + * `/analytics` global prefix in main.ts, and marked public to bypass + * the WriteKeyGuard). Loaded cross-origin via + * `