Initialize initConsoleLogCapture() via Next.js instrumentation register() hook so logs are captured from startup in headless/Docker deployments, and add X-Accel-Buffering/Cache-Control headers to the SSE stream route to prevent reverse proxies from buffering the initial payload.
7 lines
195 B
JavaScript
7 lines
195 B
JavaScript
export async function register() {
|
|
if (process.env.NEXT_RUNTIME === "nodejs") {
|
|
const { initConsoleLogCapture } = await import("@/lib/consoleLogBuffer");
|
|
initConsoleLogCapture();
|
|
}
|
|
}
|