Implemented preview functionality with next js 13 app dir

This commit is contained in:
Henrik Larsson
2023-05-16 12:52:44 +02:00
parent 47b0df33d4
commit 0a2e289d85
10 changed files with 306 additions and 29 deletions

View File

@@ -0,0 +1,12 @@
import { draftMode } from 'next/headers';
export async function GET() {
draftMode().disable();
return new Response(null, {
status: 307,
headers: {
Location: `/`,
},
})
}