add: announce routing

This commit is contained in:
clandestine8
2022-05-17 19:19:42 -04:00
parent b313f22045
commit d84b8e1097
3 changed files with 37 additions and 0 deletions
+4
View File
@@ -58,6 +58,10 @@ class Kernel extends HttpKernel
'throttle:30,1',
'bindings',
],
'announce' => [
'throttle:1000,1',
'bindings',
]
];
/**
+4
View File
@@ -48,6 +48,10 @@ class RouteServiceProvider extends ServiceProvider
Route::prefix('api')
->middleware('api')
->group(\base_path('routes/api.php'));
Route::prefix('announce')
->middleware('announce')
->group(\base_path('routes/announce.php'));
});
}
+29
View File
@@ -0,0 +1,29 @@
<?php
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\URL;
/*
* NOTICE OF LICENSE
*
* UNIT3D is open-sourced software licensed under the GNU Affero General Public License v3.0
* The details is bundled with this project in the file LICENSE.txt.
*
* @project UNIT3D
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
* @author HDVinnie
*/
/*
|--------------------------------------------------------------------------
| Announce Routes
|--------------------------------------------------------------------------
*/
if (config('unit3d.proxy_scheme')) {
URL::forceScheme(config('unit3d.proxy_scheme'));
}
if (config('unit3d.root_url_override')) {
URL::forceRootUrl(config('unit3d.root_url_override'));
}
// Announce System
Route::get('/{passkey}', [App\Http\Controllers\AnnounceController::class, 'index'])->name('announce');