mirror of
https://github.com/vercel/commerce.git
synced 2025-07-27 04:01:23 +00:00
preview bar
This commit is contained in:
9
pages/api/exitPreview.js
Normal file
9
pages/api/exitPreview.js
Normal 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()
|
||||
}
|
Reference in New Issue
Block a user