mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-10 01:52:22 +03:00
Added route registration for the available resources.
This commit is contained in:
parent
39b79d8824
commit
2afe0b903b
1 changed files with 22 additions and 4 deletions
|
@ -52,11 +52,29 @@ $route['404_override'] = 'errors/error404';
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$route['api/appointments']['get'] = 'api/appointments/get/$1';
|
$resources = [
|
||||||
$route['api/appointments']['post'] = 'api/appointments/insert';
|
'appointments',
|
||||||
$route['api/appointments']['put'] = 'api/appointments/update/$1';
|
'customers',
|
||||||
$route['api/appointments']['delete'] = 'api/appointments/delete/$1';
|
'services'
|
||||||
|
'providers',
|
||||||
|
'secretaries'
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach($resouces as $resource) {
|
||||||
|
$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)']['delete'] = 'api/v1/' . $resource . '/delete/$1';
|
||||||
|
$route['api/v1/' + $resource]['get'] = 'api/v1/' . $resource . '/get';
|
||||||
|
$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