Initial commit: Retribusi frontend dengan dashboard, event logs, dan settings
This commit is contained in:
20
api/dashboard/chart.php.example
Normal file
20
api/dashboard/chart.php.example
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* EXAMPLE: Dashboard Chart Endpoint dengan CORS Handler
|
||||
*/
|
||||
|
||||
// ================= CORS HANDLER (WAJIB PALING ATAS) =================
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
|
||||
header("Access-Control-Allow-Headers: Content-Type, Authorization, X-API-KEY");
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
|
||||
http_response_code(200);
|
||||
exit;
|
||||
}
|
||||
// ================= END CORS HANDLER =================
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
// ... logic chart yang sudah ada ...
|
||||
|
||||
Reference in New Issue
Block a user