<?php
$http_origin = is_string($_SERVER['HTTP_ORIGIN']) ? $_SERVER['HTTP_ORIGIN'] : null;
$allowed = [
'http://quiz.local',
'http://localhost:5173',
'http://dev.puzzlax.co',
'https://dev.puzzlax.co',
'http://68.183.12.30',
'https://68.183.12.30',
'http://react.puzzlax.co',
'https://react.puzzlax.co',
'http://64.225.70.198',
'https://64.225.70.198',
'http://react.puzzlax.com',
'https://react.puzzlax.com',
'http://www.puzzlax.com',
'https://www.puzzlax.com',
'http://api.puzzlax.com',
'https://api.puzzlax.com',
'http://puzzlax.com',
'https://puzzlax.com',
];
if (in_array($http_origin, $allowed)) {
header("Access-Control-Allow-Origin: $http_origin");
} else {
header('Access-Control-Allow-Origin: *');
}
header("Access-Control-Allow-Headers: Authorization, X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method");
header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE");
header("Allow: GET, POST, OPTIONS, PUT, DELETE");
use App\Kernel;
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
return function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};