Test revalidate route

This commit is contained in:
Henrik Larsson 2023-05-16 14:34:22 +02:00
parent 1bd4d29ebb
commit 9b749fde40

View File

@ -0,0 +1,11 @@
import { revalidatePath } from 'next/cache';
import { NextRequest, NextResponse } from 'next/server';
export async function GET(request: NextRequest) {
const path = request.nextUrl.searchParams.get('path') || '/';
console.log(request.nextUrl.searchParams)
revalidatePath(path);
return NextResponse.json({ revalidated: true, now: Date.now() });
}