Pony.fm/app/routes.php

146 lines
6.5 KiB
PHP
Raw Normal View History

2013-07-25 23:33:04 +02:00
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/
2013-08-21 04:40:11 +02:00
if (Config::get('app.debug')) {
Route::get('/api/web/profiler/{id}', 'Api\Web\ProfilerController@getRequest');
}
2013-07-28 23:51:35 +02:00
Route::get('/dashboard', 'TracksController@getIndex');
2013-07-25 23:33:04 +02:00
Route::get('/tracks', 'TracksController@getIndex');
Route::get('/tracks/popular', 'TracksController@getIndex');
Route::get('/tracks/random', 'TracksController@getIndex');
Route::get('tracks/{id}-{slug}', 'TracksController@getTrack');
Route::get('t{id}', 'TracksController@getShortlink' );
2013-08-31 05:16:16 +02:00
Route::get('t{id}/embed', 'TracksController@getEmbed' );
2013-08-01 10:57:08 +02:00
Route::get('t{id}/stream', 'TracksController@getStream' );
2013-08-01 04:01:41 +02:00
Route::get('t{id}/dl.{extension}', 'TracksController@getDownload' );
2013-08-01 04:01:41 +02:00
Route::get('albums', 'AlbumsController@getIndex');
Route::get('albums/{id}-{slug}', 'AlbumsController@getShow');
Route::get('a{id}', 'AlbumsController@getShortlink')->where('id', '\d+');
2013-08-19 05:39:29 +02:00
Route::get('a{id}/dl.{extension}', 'AlbumsController@getDownload' );
2013-08-01 04:01:41 +02:00
Route::get('artists', 'ArtistsController@getIndex');
Route::get('playlists', 'PlaylistsController@getIndex');
2013-07-25 23:33:04 +02:00
2013-09-01 04:59:12 +02:00
Route::get('/login', 'AuthController@getLogin');
Route::get('/auth/oauth', 'AuthController@getOAuth');
2013-07-25 23:33:04 +02:00
Route::get('/about', function() { return View::make('pages.about'); });
Route::get('/faq', function() { return View::make('pages.faq'); });
2013-08-01 04:01:41 +02:00
Route::get('i{id}/{type}.png', 'ImagesController@getImage')->where('id', '\d+');
2013-07-27 02:15:07 +02:00
2013-08-01 04:01:41 +02:00
Route::get('u{id}/avatar_{type}.png', 'UsersController@getAvatar')->where('id', '\d+');
2013-07-27 02:15:07 +02:00
2013-07-28 19:45:21 +02:00
Route::get('playlist/{id}-{slug}', 'PlaylistsController@getPlaylist');
2013-08-01 04:01:41 +02:00
Route::get('p{id}', 'PlaylistsController@getShortlink')->where('id', '\d+');
Route::get('p{id}/dl.{extension}', 'PlaylistsController@getDownload' );
2013-07-28 19:45:21 +02:00
2013-07-25 23:33:04 +02:00
Route::group(['prefix' => 'api/web'], function() {
Route::get('/taxonomies/all', 'Api\Web\TaxonomiesController@getAll');
2013-07-28 19:45:21 +02:00
Route::get('/playlists/show/{id}', 'Api\Web\PlaylistsController@getShow');
2013-07-31 13:47:16 +02:00
Route::get('/tracks', 'Api\Web\TracksController@getIndex');
Route::get('/tracks/{id}', 'Api\Web\TracksController@getShow')->where('id', '\d+');
2013-07-28 23:51:35 +02:00
2013-08-01 04:01:41 +02:00
Route::get('/albums', 'Api\Web\AlbumsController@getIndex');
Route::get('/albums/{id}', 'Api\Web\AlbumsController@getShow')->where('id', '\d+');
2013-08-27 08:53:37 +02:00
Route::get('/playlists', 'Api\Web\PlaylistsController@getIndex');
2013-08-01 10:57:08 +02:00
Route::get('/playlists/{id}', 'Api\Web\PlaylistsController@getShow')->where('id', '\d+');
Route::get('/comments/{type}/{id}', 'Api\Web\CommentsController@getIndex')->where('id', '\d+');
2013-08-01 04:01:41 +02:00
Route::get('/artists', 'Api\Web\ArtistsController@getIndex');
2013-08-01 04:47:21 +02:00
Route::get('/artists/{slug}', 'Api\Web\ArtistsController@getShow');
Route::get('/artists/{slug}/content', 'Api\Web\ArtistsController@getContent');
Route::get('/artists/{slug}/favourites', 'Api\Web\ArtistsController@getFavourites');
2013-08-01 04:01:41 +02:00
2013-07-28 23:51:35 +02:00
Route::get('/dashboard', 'Api\Web\DashboardController@getIndex');
2013-07-25 23:33:04 +02:00
Route::group(['before' => 'auth|csrf'], function() {
Route::post('/tracks/upload', 'Api\Web\TracksController@postUpload');
Route::post('/tracks/delete/{id}', 'Api\Web\TracksController@postDelete');
2013-07-28 19:45:21 +02:00
Route::post('/tracks/edit/{id}', 'Api\Web\TracksController@postEdit');
2013-07-28 10:35:31 +02:00
Route::post('/albums/create', 'Api\Web\AlbumsController@postCreate');
2013-07-28 19:45:21 +02:00
Route::post('/albums/delete/{id}', 'Api\Web\AlbumsController@postDelete');
Route::post('/albums/edit/{id}', 'Api\Web\AlbumsController@postEdit');
Route::post('/playlists/create', 'Api\Web\PlaylistsController@postCreate');
Route::post('/playlists/delete/{id}', 'Api\Web\PlaylistsController@postDelete');
Route::post('/playlists/edit/{id}', 'Api\Web\PlaylistsController@postEdit');
2013-08-01 10:57:08 +02:00
Route::post('/playlists/{id}/add-track', 'Api\Web\PlaylistsController@postAddTrack');
Route::post('/comments/{type}/{id}', 'Api\Web\CommentsController@postCreate')->where('id', '\d+');
2013-07-28 20:50:02 +02:00
Route::post('/account/settings/save', 'Api\Web\AccountController@postSave');
2013-08-01 10:57:08 +02:00
Route::post('/favourites/toggle', 'Api\Web\FavouritesController@postToggle');
Route::post('/follow/toggle', 'Api\Web\FollowController@postToggle');
2013-07-25 23:33:04 +02:00
});
Route::group(['before' => 'auth'], function() {
2013-07-28 20:50:02 +02:00
Route::get('/account/settings', 'Api\Web\AccountController@getSettings');
2013-07-27 05:00:45 +02:00
Route::get('/images/owned', 'Api\Web\ImagesController@getOwned');
2013-07-28 09:09:10 +02:00
2013-07-25 23:33:04 +02:00
Route::get('/tracks/owned', 'Api\Web\TracksController@getOwned');
Route::get('/tracks/edit/{id}', 'Api\Web\TracksController@getEdit');
2013-07-28 09:09:10 +02:00
Route::get('/albums/owned', 'Api\Web\AlbumsController@getOwned');
Route::get('/albums/edit/{id}', 'Api\Web\AlbumsController@getEdit');
2013-07-28 19:45:21 +02:00
Route::get('/playlists/owned', 'Api\Web\PlaylistsController@getOwned');
Route::get('/playlists/pinned', 'Api\Web\PlaylistsController@getPinned');
Route::get('/favourites/tracks', 'Api\Web\FavouritesController@getTracks');
Route::get('/favourites/albums', 'Api\Web\FavouritesController@getAlbums');
Route::get('/favourites/playlists', 'Api\Web\FavouritesController@getPlaylists');
2013-07-25 23:33:04 +02:00
});
Route::group(['before' => 'csrf'], function(){
Route::post('/auth/logout', 'Api\Web\AuthController@postLogout');
});
});
Route::group(['prefix' => 'account'], function() {
Route::group(['before' => 'auth'], function(){
2013-07-28 09:09:10 +02:00
Route::get('/favourites/tracks', 'FavouritesController@getTracks');
2013-07-27 02:15:07 +02:00
Route::get('/favourites/albums', 'FavouritesController@getAlbums');
Route::get('/favourites/playlists', 'FavouritesController@getPlaylists');
2013-07-25 23:33:04 +02:00
2013-07-28 09:09:10 +02:00
Route::get('/tracks', 'ContentController@getTracks');
Route::get('/tracks/edit/{id}', 'ContentController@getTracks');
Route::get('/albums', 'ContentController@getAlbums');
Route::get('/albums/edit/{id}', 'ContentController@getAlbums');
Route::get('/albums/create', 'ContentController@getAlbums');
Route::get('/playlists', 'ContentController@getPlaylists');
2013-07-25 23:33:04 +02:00
Route::get('/uploader', 'UploaderController@getIndex');
2013-07-25 23:33:04 +02:00
Route::get('/', 'AccountController@getIndex');
});
});
2013-08-01 04:01:41 +02:00
Route::get('u{id}', 'ArtistsController@getShortlink')->where('id', '\d+');
Route::get('users/{id}-{slug}', 'ArtistsController@getShortlink')->where('id', '\d+');
2013-08-01 04:47:21 +02:00
Route::get('{slug}', 'ArtistsController@getProfile');
Route::get('{slug}/content', 'ArtistsController@getProfile');
Route::get('{slug}/favourites', 'ArtistsController@getProfile');
2013-08-01 04:01:41 +02:00
2013-07-25 23:33:04 +02:00
Route::get('/', 'HomeController@getIndex');