rsnext/examples/cms-takeshape/pages/api/exit-preview.js
2020-05-18 17:44:18 -04:00

8 lines
251 B
JavaScript

export default async function exit(_, res) {
// Exit the current user from "Preview Mode". This function accepts no args.
res.clearPreviewData()
// Redirect the user back to the index page.
res.writeHead(307, { Location: '/' })
res.end()
}