Added an api method to get album info by name
This commit is contained in:
parent
42de8819a8
commit
f2ca6af5bc
@ -7,3 +7,6 @@ require 'routes/contact.php';
|
||||
require 'routes/home.php';
|
||||
require 'routes/music.php';
|
||||
require 'routes/shows.php';
|
||||
|
||||
// API routes
|
||||
require 'routes/apiv1/music.php';
|
||||
|
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');
|
Loading…
Reference in New Issue
Block a user