application/config/routes.php
//Route for pre flight CORS permission request
Route for pre flight CORS permission request
Route for pre flight CORS permission request
function option_route(){
	header('Access-Control-Allow-Origin: *');
    header("Access-Control-Allow-Headers: X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method, Device-Id,Device-Type,Device-Timezone,Authorization");
    header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE, PATCH");
    $method = $_SERVER['REQUEST_METHOD'];
    if($method == "OPTIONS") {
        http_response_code(200); exit;
    }
}
function option_route ( ) { header ( 'Access-Control-Allow-Origin: *' ) ; header ( " Access-Control-Allow-Headers: X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method, Device-Id,Device-Type,Device-Timezone,Authorization " ) ; header ( " Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE, PATCH " ) ; $ method = $ _SERVER [ 'REQUEST_METHOD' ] ; if ( $ method == " OPTIONS " ) { http_response_code ( 200 ) ; exit ; } }
Route for pre flight CORS permission request
Route for pre flight CORS permission request