export default defineEventHandler((event) => { if (process.env.NODE_ENV === "production") { const req = event.node.req; const proto = req.headers["x-forwarded-proto"] || "http"; if ( proto !== "https" && !req.headers.host?.includes("localhost") ) { const httpsUrl = `https://${req.headers.host}${req.url}`; return sendRedirect(event, httpsUrl, 301); } }});