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 + * `