%PDF- %PDF-
| Direktori : /home2/rezakur1/yt.rezakurnia.com/api/ |
| Current File : /home2/rezakur1/yt.rezakurnia.com/api/videos.php |
<?php
/**
* GET /api/videos.php
* Ambil semua video
*/
require_once __DIR__ . '/../config.php';
if ($_SERVER['REQUEST_METHOD'] !== 'GET') {
jsonError('Method not allowed', 405);
}
$result = supabaseRequest('videos', 'GET', null, 'select=*&order=id.asc');
if (!$result['success']) {
jsonError($result['error'], $result['code']);
}
jsonResponse([
'success' => true,
'count' => count($result['data'] ?? []),
'data' => $result['data'] ?? [],
]);