24 lines
553 B
PHP
24 lines
553 B
PHP
<?php
|
|
|
|
require_once __DIR__ . '/app/config.php';
|
|
|
|
// CORS заголовки
|
|
$origin = $_SERVER['HTTP_ORIGIN'] ?? '';
|
|
header("Access-Control-Allow-Origin: $origin");
|
|
header("Access-Control-Allow-Credentials: true");
|
|
header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS");
|
|
header("Access-Control-Allow-Headers: Content-Type, Authorization");
|
|
|
|
// Preflight запрос
|
|
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
|
|
http_response_code(200);
|
|
exit;
|
|
}
|
|
|
|
ignore_favicon();
|
|
|
|
check_ApiAuth($publicActions);
|
|
handleRouting($routes);
|
|
|
|
?>
|