Added an api method to get album info by name

This commit is contained in:
Gregory Ballantine committed 2016-11-28 17:06:04 -05:00
1 parent 42de8819a8
commit f2ca6af5bc
2 files changed
+17

No files matched your search

+3
View File
@@ -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
View 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');