BIG MOOOOVE to Object Storage
Deploy / deploy (push) Successful in 2m43s

This commit is contained in:
twotalesanimation
2026-07-16 22:15:58 +02:00
parent 3264abb432
commit 745634f1b6
10 changed files with 594 additions and 17 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
import { NextRequest, NextResponse } from "next/server";
import { auth } from "@/auth";
import { uploadFile } from "@/lib/storage";
import { uploadToHetzner } from "@/lib/storage";
export const config = { api: { bodyParser: false } };
@@ -30,9 +30,9 @@ export async function POST(req: NextRequest) {
}
const buffer = Buffer.from(await file.arrayBuffer());
const result = await uploadFile(buffer, file.name, file.type, "videos");
const { key } = await uploadToHetzner(buffer, file.name, file.type, "videos");
return NextResponse.json({ url: result.url, key: result.key });
return NextResponse.json({ url: `/api/files/${key}`, key });
} catch (err) {
console.error("[local-upload]", err);
return NextResponse.json({ error: "Upload failed" }, { status: 500 });