/* **************** **************** Albums **************** */ /*** Recherche ****/ Flight::route('/search/@q', function ($q) { $album_controller = new AlbumController(); // print_r($album_controller->recherche($q)); $response = $album_controller->recherche($q); echo json_encode($response); }); /***** get Albums ***/ Flight::route('GET /albums', function () { $album_controller = new AlbumController(); echo json_encode($album_controller->listAlbums()); }); Flight::route('GET /albums/limit/@limit', function ($limit) { $album_controller = new AlbumController(); echo json_encode($album_controller->listAlbumslimit($limit)); }); /***** get Album ***/ Flight::route('GET /album/@id', function ($id) { $album_controller = new AlbumController(); $album = $album_controller->getAlbum($id); echo json_encode($album); }); /***** ADD / UPDATE Album ***/ Flight::route('PUT /albums', function () { $request = Flight::request(); $album_controller = new AlbumController();