Buckets:
| import type { NextApiRequest, NextApiResponse } from "next"; | |
| export default async function preview( | |
| req: NextApiRequest, | |
| res: NextApiResponse, | |
| ) { | |
| const { secret } = req.query; | |
| // Check the secret and next parameters | |
| // This secret should only be known by this API route | |
| if (!secret) { | |
| return res.status(401).json({ message: "No token provided" }); | |
| } | |
| if (secret !== process.env.UMBRACO_PREVIEW_SECRET) { | |
| return res.status(401).json({ message: "Invalid token" }); | |
| } | |
| res.setDraftMode({ enable: true }); | |
| res.redirect("/"); | |
| res.end(); | |
| return res; | |
| } | |
Xet Storage Details
- Size:
- 584 Bytes
- Xet hash:
- a15910503ea035fae8b218fa435b5a21f5e8413e0403f336dbe4508234e987ad
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.