proxitok/routes.php

47 lines
1.4 KiB
PHP
Raw Normal View History

2022-01-30 18:02:52 -05:00
<?php
2022-03-11 12:56:19 -05:00
/** @var \Bramus\Router\Router $router */
2022-01-30 18:02:52 -05:00
use App\Helpers\Misc;
use App\Models\BaseTemplate;
2022-02-05 18:58:30 -05:00
use App\Models\HomeTemplate;
2022-01-30 18:02:52 -05:00
$router->get('/', function () {
$latte = Misc::latte();
2022-02-05 18:58:30 -05:00
$latte->render(Misc::getView('home'), new HomeTemplate);
2022-01-30 18:02:52 -05:00
});
$router->get('/about', function () {
$latte = Misc::latte();
$latte->render(Misc::getView('about'), new BaseTemplate('About'));
});
$router->get('/stream', 'ProxyController@stream');
2022-03-11 12:56:19 -05:00
$router->get('/download', 'ProxyController@download');
2022-02-05 18:58:30 -05:00
$router->get('/redirect', 'RedirectController@redirect');
2022-01-30 18:02:52 -05:00
$router->mount('/trending', function () use ($router) {
$router->get('/', 'TrendingController@get');
$router->get('/rss', 'TrendingController@rss');
});
$router->mount('/@([^/]+)', function () use ($router) {
$router->get('/', 'UserController@get');
$router->get('/rss', 'UserController@rss');
});
$router->get('/video/(\w+)', 'VideoController@get');
$router->mount('/tag', function () use ($router) {
$router->get('/([^/]+)', 'TagController@get');
$router->get('/rss', 'TagController@rss');
});
$router->get('/music/([^/]+)', 'MusicController@get');
// -- Settings -- //
$router->mount('/settings', function () use ($router) {
$router->get('/', 'SettingsController@index');
$router->post('/proxy', 'SettingsController@proxy');
});
2022-02-05 18:58:30 -05:00
$router->get('/discover', 'DiscoverController@get');