import { NextApiHandler } from "next" ; const handler = async ( req , res ) => { const { snapshotId } = req . query ; console . log ( "set snapshot: " + snapshotId ) ; res . setPreviewData ( { snapshotId } ) ; res . writeHead ( 307 , { Location : "/" } ) ; res . end ( ) ; } ; export default handler ;