koel/app/Http/routes.php

49 lines
1.6 KiB
PHP
Raw Normal View History

2015-12-13 04:42:28 +00:00
<?php
get('login', 'Auth\AuthController@getLogin');
post('login', 'Auth\AuthController@postLogin');
get('logout', 'Auth\AuthController@getLogout');
get('/', function () {
return redirect('/♫');
});
get('♫', ['middleware' => 'auth', function () {
return view('index');
}]);
Route::group(['prefix' => 'api', 'middleware' => 'auth', 'namespace' => 'API'], function () {
get('/', function () {
// Just acting as a ping service.
});
get('data', 'DataController@index');
post('settings', 'SettingController@save');
get('{id}/play', 'SongController@play')->where('id', '[a-f0-9]{32}');
get('{id}/info', 'SongController@getInfo')->where('id', '[a-f0-9]{32}');
2015-12-20 12:17:35 +00:00
post('{id}/scrobble/{timestamp}', 'SongController@scrobble')->where([
'id' => '[a-f0-9]{32}',
'timestamp' => '\d+',
]);
2015-12-13 04:42:28 +00:00
post('interaction/play', 'InteractionController@play');
post('interaction/like', 'InteractionController@like');
post('interaction/batch/like', 'InteractionController@batchLike');
post('interaction/batch/unlike', 'InteractionController@batchUnlike');
2015-12-14 13:34:34 +00:00
resource('playlist', 'PlaylistController', ['only' => ['store', 'update', 'destroy']]);
2015-12-15 00:45:10 +00:00
put('playlist/{playlist}/sync', 'PlaylistController@sync')->where(['playlist' => '\d+']);
2015-12-13 04:42:28 +00:00
2015-12-14 13:34:34 +00:00
resource('user', 'UserController', ['only' => ['store', 'update', 'destroy']]);
2015-12-13 04:42:28 +00:00
put('me', 'UserController@updateProfile');
2015-12-20 12:17:35 +00:00
get('lastfm/connect', 'LastfmController@connect');
get('lastfm/callback', [
'as' => 'lastfm.callback',
'uses' => 'LastfmController@callback',
]);
delete('lastfm/disconnect', 'LastfmController@disconnect');
2015-12-13 04:42:28 +00:00
});