import { NextApiHandler } from "next" ; const handler = async ( req , res ) => { const { snapshotId } = req . query ; console . log ( "redirect snapshot: " + snapshotId ) ; res . setHeader ( "Cache-Control" , "public, s-maxage=31536000" ) ; res . write ( `<!DOCTYPE html><html><head><meta http-equiv="Refresh" content="0; url=/r/${ encodeURIComponent ( snapshotId as string ) }" /></head>` ) ; res . end ( ) ; } ; export default handler ;