Vault Empty
Please import accounts from the sidebar to begin.
export default { async fetch(request, env) { const url = new URL(request.url); const corsHeaders = { "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Methods": "GET, POST, DELETE, OPTIONS", "Access-Control-Allow-Headers": "Content-Type, X-Auth-Email, X-Auth-Key", }; if (request.method === "OPTIONS") return new Response(null, { headers: corsHeaders }); if (url.pathname.startsWith("/api/")) { const apiPath = url.pathname.replace("/api/", "/"); const apiUrl = `https://api.cloudflare.com/client/v4${apiPath}`; try { const response = await fetch(apiUrl, { method: request.method, headers: { "X-Auth-Email": request.headers.get("X-Auth-Email"), "X-Auth-Key": request.headers.get("X-Auth-Key"), "Content-Type": "application/json", }, body: request.method !== "GET" && request.method !== "DELETE" ? await request.text() : null, }); const data = await response.json(); return new Response(JSON.stringify(data), { headers: { ...corsHeaders, "Content-Type": "application/json" } }); } catch (err) { return new Response(JSON.stringify({ error: err.message }), { status: 500, headers: corsHeaders }); } } return new Response(htmlDashboard(), { headers: { "Content-Type": "text/html" } }); }, }; function htmlDashboard() { return `
Format: email (enter) apikey (double enter) next account
You are about to delete 0 domain(s)
Please import accounts from the sidebar to begin.