<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2019 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

// [ 应用入口文件 ]
namespace think;

require __DIR__ . '/../vendor/autoload.php';

//指定允许其他域名访问
header('Access-Control-Allow-Origin: *');
//是否允许后续请求携带认证信息（cookies）,该值只能是true,否则不返回
header('Access-Control-Allow-Credentials:true');
//预检结果缓存时间,也就是上面说到的缓存啦
header('Access-Control-Max-Age: 1800');
//允许的请求类型
header('Access-Control-Allow-Methods:GET,POST,OPTIONS,PUT,DELETE');
//允许的请求头字段
header('Access-Control-Allow-Headers:x-requested-with,content-type');

// 执行HTTP应用并响应
$http = (new App())->http;

$response = $http->run();

$response->send();

$http->end($response);
