prof/cors-helper
Composer 安装命令:
composer require prof/cors-helper
包简介
This library is to enable cross site origin sharing
README 文档
README
..............HOW TO USE CORS-HELPER............. STEP 1:In the root folder of your file run this command composer require prof/cors-helper STEP 2:put this at the top of all your code | require DIR.'/vendor/autoload.php'; STEP 3: place this immediately after the above line | use CorsHelper\CorsHelper; STEP 4: Call function like this CorsHelper::GrantRequest(); This is how the default set up look like,you did not need to do this below set up,am just showing you how the default set up look like. ......THIS IS THE DEFAULT SETUP...... CorsHelper::GrantRequest([ 'origin'=>['All origin'], 'method'=>['POST','GET','DELETE','PUT','PATCH','OPTIONS'], 'header'=>['X-Requested-With','token','Authorization','X-Auth-Token','Origin','Content-Type','Cache-Control','Pragma','Accept','Accept-Encoding'], 'contentType'=>'text/plain'; 'credentials'=>true; 'maxAge'=>72800, ]) .......FULL DEFAULT EXAMPLE...... require DIR.'/vendor/autoload.php'; use CorsHelper\CorsHelper; CorsHelper::GrantRequest(); So simple cors is enable and you can start your work without any cors problem. NOTE:if you want to customize cors-helper,you can reset the above setup to your taste.
统计信息
- 总下载量: 61
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-07-29