import type { NextApiRequest, NextApiResponse } from "next"; import { WEBAPP_URL } from "@calcom/lib/constants"; export default async function handler(req: NextApiRequest, res: NextApiResponse) { if (req.method === "POST") { // Set Content-Type header to text/html res.setHeader("Content-Type", "text/html"); const url = req.query.url as string; if (!url) return res.status(400).json({ message: "Missing URL in query parameters" }); res.setHeader("Content-Type", "text/html"); // Generate HTML with embedded Cal component const htmlResponse = `