@@ -0,0 +1,12 @@
|
||||
import { NextResponse } from 'next/server'
|
||||
|
||||
// Force runtime evaluation so the token is read from the container's
|
||||
// environment on each request instead of being frozen at build time.
|
||||
// This lets Docker compose supply CHATWOOT_TOKEN via env_file.
|
||||
export const dynamic = 'force-dynamic'
|
||||
|
||||
export async function GET() {
|
||||
// Chatwoot website tokens are public by design (they ship in the widget),
|
||||
// so exposing it through this endpoint is safe.
|
||||
return NextResponse.json({ token: process.env.CHATWOOT_TOKEN ?? null })
|
||||
}
|
||||
Reference in New Issue
Block a user