// ============================================ // CLOUDFLARE WORKERS SCRIPT // File: worker.js // Deploy di: https://persibku.abdulazid000.workers.dev/ // ============================================ // Daftar kode aktivasi valid const VALID_CODES = [ 'BESSTV2025', 'PREMIUM2025', 'VIPACCESS', 'CEPAKEW123', 'STREAMING2025' ]; // HTML untuk halaman login const LOGIN_PAGE = ` BessTV Premium - Login
BessTV
PREMIUM
🔐
Kode aktivasi tidak valid! Silakan coba lagi.
Belum punya kode aktivasi?
Hubungi @cepakew untuk mendapatkan akses premium.
`; // HTML untuk halaman utama TV Streaming (diambil dari index.html Anda) const MAIN_APP = ` TV STREAMING
Poster Siaran
`; // ============================================ // CLOUDFLARE WORKERS EVENT HANDLER // ============================================ addEventListener('fetch', event => { event.respondWith(handleRequest(event.request)) }) async function handleRequest(request) { const url = new URL(request.url); const path = url.pathname; // ROUTING switch (path) { case '/': // Halaman login (default) return new Response(LOGIN_PAGE, { headers: { 'Content-Type': 'text/html;charset=UTF-8', 'Cache-Control': 'no-cache' } }); case '/app': // Halaman utama TV Streaming return new Response(MAIN_APP, { headers: { 'Content-Type': 'text/html;charset=UTF-8', 'Cache-Control': 'no-cache' } }); case '/api/validate': // API untuk validasi kode aktivasi if (request.method !== 'POST') { return new Response(JSON.stringify({ valid: false }), { status: 405, headers: { 'Content-Type': 'application/json' } }); } try { const body = await request.json(); const code = body.code ? body.code.toUpperCase().trim() : ''; const isValid = VALID_CODES.includes(code); return new Response(JSON.stringify({ valid: isValid }), { headers: { 'Content-Type': 'application/json', 'Cache-Control': 'no-cache' } }); } catch (error) { return new Response(JSON.stringify({ valid: false }), { status: 400, headers: { 'Content-Type': 'application/json' } }); } default: // 404 untuk path lain return new Response('Not Found', { status: 404 }); } }