mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
11 lines
290 B
TypeScript
11 lines
290 B
TypeScript
import { NextApiResponse } from "next";
|
|
|
|
export default async function exit(_, res: NextApiResponse) {
|
|
// Exit Draft Mode by removing the cookie
|
|
res.setDraftMode({ enable: false });
|
|
|
|
// Redirect the user back to the index page.
|
|
res.writeHead(307, { Location: "/" });
|
|
res.end();
|
|
}
|