Update spotify connection

This commit is contained in:
2022-01-17 16:51:49 +01:00
parent 9e822ba674
commit f02635b83c
13 changed files with 130 additions and 88 deletions

View File

@@ -6,6 +6,17 @@ Route.get('/stats', 'StatsController.index')
Route.get('/states', 'StatesController.index')
Route.resource('/locations', 'LocationsController').only(['index', 'store'])
Route.group(() => {
Route.get('/', 'SongsController.getCurrentSong')
Route.get('/history', 'SongsController.getHistory')
Route.get('/top/track', 'SongsController.getTopTrack')
Route.get('/top/artist', 'SongsController.getTopArtist')
Route.get('/authorize', 'SongsController.authorize')
Route.get('/callback', 'SongsController.callback')
}).prefix('spotify')
Route.group(() => {
Route.resource('/users', 'UsersController').except(['edit', 'create'])
@@ -21,17 +32,6 @@ Route.group(() => {
Route.post('/commands', 'StatsController.incrementCommandCount')
Route.post('/builds', 'StatsController.incrementBuildCount')
}).prefix('stats')
Route.group(() => {
Route.get('/', 'SongsController.getCurrentSong')
Route.get('/history', 'SongsController.getHistory')
Route.get('/top/track', 'SongsController.getTopTrack')
Route.get('/top/artist', 'SongsController.getTopArtist')
Route.get('/authorize', 'SongsController.authorize')
Route.get('/callback', 'SongsController.callback')
}).prefix('spotify')
}).middleware('auth:web,api')
Route.get('/files/:filename', async({ response, params }) => {