-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add tutorial for the supreme court hearings
- Loading branch information
1 parent
5cd4cc7
commit 87c6873
Showing
9 changed files
with
832 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { NextResponse } from "next/server"; | ||
|
||
export async function GET(request: Request) { | ||
const { searchParams } = new URL(request.url); | ||
const fileId = searchParams.get("fileId"); | ||
|
||
if (!fileId) { | ||
return new NextResponse("File ID is required", { status: 400 }); | ||
} | ||
|
||
try { | ||
const driveUrl = `https://drive.google.com/uc?export=download&id=${fileId}`; | ||
const response = await fetch(driveUrl); | ||
|
||
if (!response.ok) { | ||
throw new Error("Failed to download file from Google Drive"); | ||
} | ||
|
||
const data = await response.blob(); | ||
return new NextResponse(data); | ||
} catch (error) { | ||
console.error("Error downloading tutorial dataset:", error); | ||
return new NextResponse("Failed to download tutorial dataset", { | ||
status: 500, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.