Cachet is now a Laravel 5 app

This commit is contained in:
Joseph Cohen
2015-03-20 18:30:45 -06:00
parent 7cfa158e68
commit b4ac66d727
338 changed files with 4164 additions and 4114 deletions

View File

@@ -0,0 +1,55 @@
<?php
namespace CachetHQ\Cachet\Http\Routes;
use Illuminate\Contracts\Routing\Registrar;
class ApiRoutes
{
/**
* Define the api routes.
*
* @param \Illuminate\Contracts\Routing\Registrar $router
*
* @return void
*/
public function map(Registrar $router)
{
$router->group([
'middleware' => 'allowedDomains',
'namespace' => 'Api',
'prefix' => 'api/v1',
], function ($router) {
// Components
$router->get('components', 'ComponentController@getComponents');
$router->get('components/{id}', 'ComponentController@getComponent');
// Incidents
$router->get('incidents', 'IncidentController@getIncidents');
$router->get('incidents/{id}', 'IncidentController@getIncident');
// Metrics
$router->get('metrics', 'MetricController@getMetrics');
$router->get('metrics/{id}', 'MetricController@getMetric');
$router->get('metrics/{id}/points', 'MetricController@getMetricPoints');
// Api protected
$router->group(['middleware' => 'auth.api'], function ($router) {
$router->post('components', 'ComponentController@postComponents');
$router->post('incidents', 'IncidentController@postIncidents');
$router->post('metrics', 'MetricController@postMetrics');
$router->post('metrics/{id}/points', 'MetricPointController@postMetricPoints');
$router->put('components/{id}', 'ComponentController@putComponent');
$router->put('incidents/{id}', 'IncidentController@putIncident');
$router->put('metrics/{id}', 'MetricController@putMetric');
$router->put('metrics/{id}/points/{metric_id}', 'MetricPointController@putMetricPoint');
$router->delete('components/{id}', 'ComponentController@deleteComponent');
$router->delete('incidents/{id}', 'IncidentController@deleteIncident');
$router->delete('metrics/{id}', 'MetricController@deleteMetric');
$router->delete('metrics/{id}/points/{metric_id}', 'MetricPointController@deleteMetricPoint');
});
});
}
}