Skip to content

Commit

Permalink
[apps/www/api] Improve security with ACAs
Browse files Browse the repository at this point in the history
  • Loading branch information
54nd10 committed Dec 21, 2023
1 parent c04ed16 commit 0a59a5d
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion apps/www/src/app/api/revalidate/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
import {NextResponse} from 'next/server'
import {revalidateTag} from 'next/cache'

export async function OPTIONS() {
return NextResponse.json(
{},
{
status: 200,
headers: {
'Access-Control-Allow-Origin': 'https://cms.56k.cloud',
'Access-Control-Allow-Methods': 'OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type, Authorization'
}
}
)
}

export async function GET() {
revalidateTag('strapi')
return new Response('Strapi tag revalidated')
return new Response(
'Strapi tag revalidated',
{
status: 200,
headers: {
'Access-Control-Allow-Origin': 'https://cms.56k.cloud',
'Access-Control-Allow-Methods': 'GET',
'Access-Control-Allow-Headers': 'Content-Type, Authorization'
}
}
)
}

0 comments on commit 0a59a5d

Please sign in to comment.