<?php
namespace think;
header('Access-Control-Allow-Origin:*');
header('Access-Control-Allow-Methods:*');
header('Access-Control-Allow-Headers:Content-Type,Content-Length,Accept-Encoding,X-Requested-with,Origin,allowHeaders,Authorization,token');
$REQUEST_METHOD = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : "";
if ($REQUEST_METHOD == 'OPTIONS') {
die();
}
if($_SERVER['REQUEST_METHOD'] == 'OPTIONS'){
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization");
header('Access-Control-Allow-Methods: GET, POST, PUT,DELETE,OPTIONS,PATCH');
file_put_contents('option.txt',json_encode($_REQUEST));
exit;
}
header("Access-Control-Request-Headers: Origin, X-Requested-With, content-Type, Accept, Authorization");
require __DIR__ . '/../thinkphp/base.php';
define('APP_PATH', __DIR__ . '/..');
Container::get('app')->run()->send();