1
0
mirror of https://github.com/vercel/commerce.git synced 2025-06-09 17:46:57 +00:00

Test revalidate route

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

@ -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() });
}