Update src/app/api/events/route.ts

Co-authored-by: qodo-free-for-open-source-projects[bot] <189517486+qodo-free-for-open-source-projects[bot]@users.noreply.github.com>
This commit is contained in:
zenchantlive 2026-02-13 00:00:14 -08:00 committed by GitHub
parent ec3bfa03ef
commit 8def5ae1a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,7 +7,20 @@ const HEARTBEAT_MS = 15_000;
export async function GET(request: Request): Promise<Response> {
const url = new URL(request.url);
const projectRoot = canonicalizeWindowsPath(url.searchParams.get('projectRoot') ?? process.cwd());
const projectRootSearchParam = url.searchParams.get('projectRoot');
if (!projectRootSearchParam) {
return Response.json(
{
ok: false,
error: {
classification: 'bad_args',
message: 'The `projectRoot` query parameter is required.',
},
},
{ status: 400 },
);
}
const projectRoot = canonicalizeWindowsPath(projectRootSearchParam);
try {
getIssuesWatchManager().startWatch(projectRoot);