Openstatus www.openstatus.dev
at 4c0f4c00a38753a5d0dfd7e7b7b7706dec6f1503 20 lines 509 B view raw
1import { put } from "@vercel/blob"; 2import { NextResponse } from "next/server"; 3 4export async function POST(request: Request): Promise<NextResponse> { 5 const { searchParams } = new URL(request.url); 6 const filename = searchParams.get("filename"); 7 8 if (!filename || !request.body) { 9 return NextResponse.json( 10 { error: "Internal Server Error" }, 11 { status: 500 }, 12 ); 13 } 14 15 const blob = await put(filename, request.body, { 16 access: "public", 17 }); 18 19 return NextResponse.json(blob); 20}