feat: init new self-hosting method

This commit is contained in:
swve 2024-04-21 11:50:45 +02:00
parent d5791d99d5
commit d1fde17220
11 changed files with 663 additions and 492 deletions

View file

@ -0,0 +1,19 @@
import { NextRequest, NextResponse } from 'next/server'
import { revalidateTag } from 'next/cache'
export async function GET(request: NextRequest) {
const tag: any = request.nextUrl.searchParams.get('tag')
revalidateTag(tag)
return NextResponse.json(
{ revalidated: true, now: Date.now(), tag },
{
status: 200,
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type, Authorization',
},
}
)
}