Skip to content

Commit be13eb6

Browse files
authored
Merge pull request #79 from ghosind/fix/issue-78
fix: check API_SERVER to avoid prerender error
2 parents 6f57639 + c25e27f commit be13eb6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/web/src/app/sse/keink/route.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import { NextRequest } from 'next/server';
33
export const runtime = 'nodejs';
44

55
export async function GET(req: NextRequest) {
6+
if (!process.env.API_SERVER) {
7+
return new Response('API_SERVER is not defined', { status: 500 });
8+
}
9+
610
const { readable, writable } = new TransformStream();
711
const writer = writable.getWriter();
812
const encoder = new TextEncoder();

0 commit comments

Comments
 (0)