Вынес роуты в отдельный файл

This commit is contained in:
2024-09-15 18:00:02 +08:00
parent 8483dc586e
commit f0cfe4eda7
3 changed files with 24 additions and 48 deletions

16
src/config/routes.php Normal file
View File

@@ -0,0 +1,16 @@
<?php
declare(strict_types=1);
use App\Controllers\HomeController;
use App\Controllers\PlaylistController;
return [
'GET /' => (new HomeController())->index(...),
'GET /page/@page:[0-9]+' => (new HomeController())->index(...),
'GET /faq' => (new HomeController())->faq(...),
'GET /@id:[a-zA-Z0-9_-]+' => (new PlaylistController())->download(...),
'GET /?[a-zA-Z0-9_-]+' => (new PlaylistController())->download(...),
'GET /@id:[a-zA-Z0-9_-]+/details' => (new PlaylistController())->details(...),
'GET /@id:[a-zA-Z0-9_-]+/json' => (new PlaylistController())->json(...),
];