misc_pterodactyl-panel/app/Providers/RouteServiceProvider.php

66 lines
2.3 KiB
PHP
Raw Normal View History

<?php
namespace Pterodactyl\Providers;
use Illuminate\Support\Facades\Route;
2021-07-25 19:24:52 +00:00
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to the controller routes in your routes file.
*
* In addition, it is set as the URL generator's root namespace.
*
* @var string
*/
protected $namespace = 'Pterodactyl\Http\Controllers';
/**
* Define the routes for the application.
*/
public function map()
{
2017-04-02 01:01:10 +00:00
Route::middleware(['web', 'auth', 'csrf'])
->namespace($this->namespace . '\Base')
->group(base_path('routes/base.php'));
2017-04-02 01:01:10 +00:00
Route::middleware(['web', 'auth', 'admin', 'csrf'])->prefix('/admin')
->namespace($this->namespace . '\Admin')
->group(base_path('routes/admin.php'));
2017-04-02 01:01:10 +00:00
2017-04-02 01:18:56 +00:00
Route::middleware(['web', 'csrf'])->prefix('/auth')
->namespace($this->namespace . '\Auth')
->group(base_path('routes/auth.php'));
2017-04-02 01:01:10 +00:00
2020-06-25 03:38:13 +00:00
Route::middleware(['web', 'csrf', 'auth', 'server', 'node.maintenance'])
->prefix('/api/server/{server}')
->namespace($this->namespace . '\Server')
->group(base_path('routes/server.php'));
2017-04-02 01:01:10 +00:00
Route::middleware([
sprintf('throttle:%s,%s', config('http.rate_limit.application'), config('http.rate_limit.application_period')),
'api',
])->prefix('/api/application')
2018-01-20 01:58:57 +00:00
->namespace($this->namespace . '\Api\Application')
->group(base_path('routes/api-application.php'));
2017-11-19 20:05:13 +00:00
Route::middleware([
//sprintf('throttle:%s,%s', config('http.rate_limit.client'), config('http.rate_limit.client_period')),
'client-api',
])->prefix('/api/client')
->namespace($this->namespace . '\Api\Client')
->group(base_path('routes/api-client.php'));
Route::middleware(['daemon'])->prefix('/api/remote')
2018-01-20 01:58:57 +00:00
->namespace($this->namespace . '\Api\Remote')
->group(base_path('routes/api-remote.php'));
2021-07-25 19:24:52 +00:00
RateLimiter::for('pull', function () {
return Limit::perMinute(10);
});
2017-04-02 01:01:10 +00:00
}
}