preview bar

This commit is contained in:
Joel Varty
2021-06-23 10:21:22 -04:00
parent 4929032e5f
commit 00922a8c7d
11 changed files with 396 additions and 139 deletions

9
pages/api/exitPreview.js Normal file
View File

@@ -0,0 +1,9 @@
export default async (req, res) => {
// Clears the preview mode cookies.
// This function accepts no arguments.
res.clearPreviewData()
// Redirect to the slug
res.writeHead(307, { Location: req.query.slug })
res.end()
}