22 lines
577 B
PHP
22 lines
577 B
PHP
<?php
|
|
|
|
use App\Kernel;
|
|
|
|
|
|
header('Access-Control-Allow-Origin: *');
|
|
header("Access-Control-Allow-Headers: 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");
|
|
$method = $_SERVER['REQUEST_METHOD'];
|
|
if ($method == "OPTIONS") {
|
|
die();
|
|
}
|
|
|
|
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
|
|
|
|
|
|
|
|
return function (array $context) {
|
|
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
|
|
};
|