d5837e03cc
## Documentation / Examples - [X] Make sure the linting passes by running `pnpm lint` - [X] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md) Co-authored-by: Balázs Orbán <info@balazsorban.com>
8 lines
251 B
TypeScript
8 lines
251 B
TypeScript
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()
|
|
}
|