mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 22:16:58 +00:00
Test revalidate route
This commit is contained in:
parent
1bd4d29ebb
commit
9b749fde40
11
app/api/revalidate/route.ts
Normal file
11
app/api/revalidate/route.ts
Normal 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() });
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user