Update code

This commit is contained in:
UltraLionFr
2025-08-20 15:16:00 +02:00
parent 0c1a0d74d7
commit f6170fa581
9 changed files with 341 additions and 261 deletions
+25
View File
@@ -0,0 +1,25 @@
import { prisma } from "@/lib/prisma";
import { NextResponse } from "next/server";
export async function GET(
request: Request,
{ params }: { params: { id: string } }
) {
const { id } = params;
if (!id) {
return new NextResponse("Invalid ID", { status: 400 });
}
const paste = await prisma.paste.findUnique({ where: { id } });
if (!paste) {
return new NextResponse("Paste not found", { status: 404 });
}
return new NextResponse(paste.content, {
headers: {
"Content-Type": "text/plain; charset=utf-8",
"Cache-Control": "no-store",
},
});
}
+5
View File
@@ -0,0 +1,5 @@
import { redirect } from "next/navigation";
export default function RawIndexPage() {
redirect("/");
}