-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[apps/www/api] Improve security with ACAs
- Loading branch information
Showing
1 changed file
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
} | ||
} | ||
) | ||
} |