Added an api method to get album info by name
This commit is contained in:
14
app/routes/apiv1/music.php
Normal file
14
app/routes/apiv1/music.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
// music design #1
|
||||
$app->get('/apiv1/music/get-album/:albumid', function($albumid) use($app) {
|
||||
|
||||
$album = $app->album->where('id', $albumid)->first();
|
||||
|
||||
if ($album) {
|
||||
echo json_encode($album);
|
||||
} else {
|
||||
echo 'Not found';
|
||||
}
|
||||
|
||||
})->name('apiv1.music.get-album');
|
Reference in New Issue
Block a user