mirror of
https://github.com/fsolla/teqo.git
synced 2026-12-03 22:13:06 +00:00
23 lines
693 B
TypeScript
23 lines
693 B
TypeScript
import { NextResponse } from 'next/server'
|
|
|
|
import {
|
|
buildCampaignServiceWorkerScript,
|
|
CAMPAIGN_PWA_SCOPE,
|
|
resolveCampaignPwaBuildId,
|
|
} from '@/utilities/campaignPwa'
|
|
|
|
// Runtime env only: CLI `--prebuilt` builds have no VERCEL_* build-time envs
|
|
// (prod served `campanha-dev`); `VERCEL_DEPLOYMENT_ID` exists at runtime.
|
|
export const dynamic = 'force-dynamic'
|
|
|
|
export function GET(): NextResponse {
|
|
const script = buildCampaignServiceWorkerScript(resolveCampaignPwaBuildId())
|
|
|
|
return new NextResponse(script, {
|
|
headers: {
|
|
'Content-Type': 'text/javascript; charset=utf-8',
|
|
'Cache-Control': 'no-cache',
|
|
'Service-Worker-Allowed': CAMPAIGN_PWA_SCOPE,
|
|
},
|
|
})
|
|
}
|