forked from mirrors/easyappointments
Added dynamic routes for the API controllers.
This commit is contained in:
parent
550cee6765
commit
a33594a17e
2 changed files with 8 additions and 12 deletions
|
@ -341,6 +341,7 @@ $config['csrf_protection'] = TRUE;
|
||||||
$config['csrf_token_name'] = 'csrfToken';
|
$config['csrf_token_name'] = 'csrfToken';
|
||||||
$config['csrf_cookie_name'] = 'csrfCookie';
|
$config['csrf_cookie_name'] = 'csrfCookie';
|
||||||
$config['csrf_expire'] = 7200;
|
$config['csrf_expire'] = 7200;
|
||||||
|
$config['csrf_exclude_uris'] = ['api/v1/.*'];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
@ -55,26 +55,21 @@ $route['404_override'] = 'errors/error404';
|
||||||
$resources = [
|
$resources = [
|
||||||
'appointments',
|
'appointments',
|
||||||
'customers',
|
'customers',
|
||||||
'services'
|
'services',
|
||||||
|
'categories',
|
||||||
|
'admins',
|
||||||
'providers',
|
'providers',
|
||||||
'secretaries'
|
'secretaries',
|
||||||
|
'settings'
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach($resouces as $resource) {
|
foreach($resources as $resource) {
|
||||||
$route['api/v1/' . $resource]['post'] = 'api/v1/' . $resource . '/post';
|
$route['api/v1/' . $resource]['post'] = 'api/v1/' . $resource . '/post';
|
||||||
$route['api/v1/' . $resource . '/(:num)']['put'] = 'api/v1/' . $resource . '/put/$1';
|
$route['api/v1/' . $resource . '/(:num)']['put'] = 'api/v1/' . $resource . '/put/$1';
|
||||||
$route['api/v1/' . $resource . '/(:num)']['delete'] = 'api/v1/' . $resource . '/delete/$1';
|
$route['api/v1/' . $resource . '/(:num)']['delete'] = 'api/v1/' . $resource . '/delete/$1';
|
||||||
$route['api/v1/' + $resource]['get'] = 'api/v1/' . $resource . '/get';
|
$route['api/v1/' . $resource]['get'] = 'api/v1/' . $resource . '/get';
|
||||||
$route['api/v1/' . $resource . '/(:num)']['get'] = 'api/v1/' . $resource . '/get/$1';
|
$route['api/v1/' . $resource . '/(:num)']['get'] = 'api/v1/' . $resource . '/get/$1';
|
||||||
}
|
}
|
||||||
|
|
||||||
$route['api/v1/appointments']['get'] = 'api/v1/appointments/get';
|
|
||||||
$route['api/v1/appointments/(:num)']['get'] = 'api/v1/appointments/get/$1';
|
|
||||||
|
|
||||||
// $route['api/v1/(:any)']['post'] = 'api/v1/$1/post/';
|
|
||||||
// $route['api/v1/(:any)/$2']['put'] = 'api/v1/$1/put/$2';
|
|
||||||
// $route['api/v1/(:any)/$2']['delete'] = 'api/v1/$1/delete/$2';
|
|
||||||
// $route['api/v1/(:any)/$2']['get'] = 'api/v1/$1/get/$2';
|
|
||||||
|
|
||||||
/* End of file routes.php */
|
/* End of file routes.php */
|
||||||
/* Location: ./application/config/routes.php */
|
/* Location: ./application/config/routes.php */
|
||||||
|
|
Loading…
Reference in a new issue