mirror of
https://github.com/Yanyutin753/ChatGPT-Next-Web-LangChain-Gpt-4-All.git
synced 2025-10-20 19:01:05 +00:00
feat: support custom s3 service
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { auth } from "../../auth";
|
||||
import S3FileStorage from "../../../utils/r2_file_storage";
|
||||
import S3FileStorage from "../../../utils/s3_file_storage";
|
||||
|
||||
async function handle(
|
||||
req: NextRequest,
|
||||
@@ -10,13 +9,6 @@ async function handle(
|
||||
return NextResponse.json({ body: "OK" }, { status: 200 });
|
||||
}
|
||||
|
||||
// const authResult = auth(req);
|
||||
// if (authResult.error) {
|
||||
// return NextResponse.json(authResult, {
|
||||
// status: 401,
|
||||
// });
|
||||
// }
|
||||
|
||||
try {
|
||||
var file = await S3FileStorage.get(params.path[0]);
|
||||
return new Response(file?.transformToWebStream(), {
|
||||
@@ -34,3 +26,4 @@ async function handle(
|
||||
export const GET = handle;
|
||||
|
||||
export const runtime = "edge";
|
||||
export const revalidate = 0;
|
||||
|
Reference in New Issue
Block a user