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;
|
2022-03-29 13:30:31 -04:00
|
|
|
use App\Helpers\Wrappers;
|
2022-01-30 18:02:52 -05:00
|
|
|
use App\Models\BaseTemplate;
|
|
|
|
|
|
|
|
$router->get('/', function () {
|
2022-03-29 13:30:31 -04:00
|
|
|
$latte = Wrappers::latte();
|
|
|
|
$latte->render(Misc::getView('home'), new BaseTemplate('Home'));
|
2022-01-30 18:02:52 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
$router->get('/about', function () {
|
2022-03-29 13:30:31 -04:00
|
|
|
$latte = Wrappers::latte();
|
2022-01-30 18:02:52 -05:00
|
|
|
$latte->render(Misc::getView('about'), new BaseTemplate('About'));
|
|
|
|
});
|
|
|
|
|
2022-03-11 16:46:12 -05:00
|
|
|
$router->get('/verify', function () {
|
2022-03-29 13:30:31 -04:00
|
|
|
$latte = Wrappers::latte();
|
2022-03-11 16:46:12 -05:00
|
|
|
$latte->render(Misc::getView('verify'), new BaseTemplate('Verify'));
|
|
|
|
});
|
|
|
|
|
2022-01-30 18:02:52 -05:00
|
|
|
$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');
|
2022-03-14 06:50:47 -04:00
|
|
|
$router->get('/video/(\w+)', 'UserController@video');
|
2022-01-30 18:02:52 -05:00
|
|
|
$router->get('/rss', 'UserController@rss');
|
|
|
|
});
|
|
|
|
|
2022-06-12 06:50:16 -04:00
|
|
|
// Deprecated, please use /@USERNAME/video/VIDEO_ID instead
|
2022-01-30 18:02:52 -05:00
|
|
|
$router->get('/video/(\w+)', 'VideoController@get');
|
2022-06-12 06:50:16 -04:00
|
|
|
// Workaround that allows /t endpoints
|
|
|
|
$router->get('/t/([^/]+)', 'VideoController@get');
|
2022-01-30 18:02:52 -05:00
|
|
|
|
2022-03-29 13:30:31 -04:00
|
|
|
$router->mount('/tag/([^/]+)', function () use ($router) {
|
|
|
|
$router->get('/', 'TagController@get');
|
2022-01-30 18:02:52 -05:00
|
|
|
$router->get('/rss', 'TagController@rss');
|
|
|
|
});
|
|
|
|
|
|
|
|
$router->get('/music/([^/]+)', 'MusicController@get');
|
|
|
|
|
|
|
|
// -- Settings -- //
|
|
|
|
$router->mount('/settings', function () use ($router) {
|
|
|
|
$router->get('/', 'SettingsController@index');
|
2022-03-29 13:30:31 -04:00
|
|
|
$router->post('/general', 'SettingsController@general');
|
2022-03-11 14:50:11 -05:00
|
|
|
$router->post('/api', 'SettingsController@api');
|
2022-01-30 18:02:52 -05:00
|
|
|
});
|
|
|
|
|
2022-02-05 18:58:30 -05:00
|
|
|
$router->get('/discover', 'DiscoverController@get');
|
2022-04-10 06:10:48 -04:00
|
|
|
|
|
|
|
// -- EMBED -- //
|
|
|
|
$router->get('/embed/v2/(\d+)', 'EmbedController@v2');
|