Openstatus
www.openstatus.dev
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}