...
|
...
|
@@ -35,23 +35,18 @@ class RouteServiceProvider extends ServiceProvider |
|
|
*/
|
|
|
public function boot()
|
|
|
{
|
|
|
$sld_prefix = isset($_SERVER['HTTP_HOST']) ? explode('.',$_SERVER['HTTP_HOST'])[0] : "";
|
|
|
if($sld_prefix == 'm'){
|
|
|
$this->mapAmpRoutes();
|
|
|
}else{
|
|
|
$this->configureRateLimiting();
|
|
|
$this->configureRateLimiting();
|
|
|
|
|
|
$this->routes(function () {
|
|
|
Route::prefix('api')
|
|
|
->middleware('api')
|
|
|
->namespace($this->namespace)
|
|
|
->group(base_path('routes/api.php'));
|
|
|
$this->routes(function () {
|
|
|
Route::prefix('api')
|
|
|
->middleware('api')
|
|
|
->namespace($this->namespace)
|
|
|
->group(base_path('routes/api.php'));
|
|
|
|
|
|
Route::middleware('web')
|
|
|
->namespace($this->namespace)
|
|
|
->group(base_path('routes/web.php'));
|
|
|
});
|
|
|
}
|
|
|
Route::middleware('web')
|
|
|
->namespace($this->namespace)
|
|
|
->group(base_path('routes/web.php'));
|
|
|
});
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -65,13 +60,4 @@ protected function configureRateLimiting() |
|
|
return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
|
|
|
});
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @author Akun
|
|
|
* @date 2024/01/26 11:03
|
|
|
*/
|
|
|
protected function mapAmpRoutes(){
|
|
|
Route::namespace('App\Http\Controllers\Amp')
|
|
|
->group(base_path('routes/amp.php'));
|
|
|
}
|
|
|
} |
...
|
...
|
|