Add back API (#80)

Re-implements the API after it was removed in the Laravel 5.3 upgrade.
This commit is contained in:
Dane Everitt 2016-09-05 16:21:36 -04:00 committed by GitHub
parent b02df8e610
commit 7529e961de
23 changed files with 1620 additions and 81 deletions

View file

@ -36,44 +36,10 @@ class RouteServiceProvider extends ServiceProvider
*/
public function map()
{
$this->mapWebRoutes();
$this->mapApiRoutes();
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWebRoutes()
{
Route::group([
// 'middleware' => 'web',
'namespace' => $this->namespace,
], function ($router) {
Route::group(['namespace' => $this->namespace], function ($router) {
foreach (glob(app_path('Http//Routes') . '/*.php') as $file) {
$this->app->make('Pterodactyl\\Http\\Routes\\' . basename($file, '.php'))->map($router);
}
});
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
{
Route::group([
'middleware' => 'api',
'namespace' => $this->namespace,
'prefix' => 'api',
], function ($router) {
foreach (glob(app_path('Http//Routes//Api') . '/*.php') as $file) {
$this->app->make('Pterodactyl\\Http\\Routes\\Api\\' . basename($file, '.php'))->map($router);
}
});
}
}