From a8c636e936112cc5b36b8fc9d502709d8f4c4c6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 9 Jan 2014 09:57:18 +0100 Subject: [PATCH] [add] get one entry with the API --- app/controllers/api.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/controllers/api.php b/app/controllers/api.php index 6ca856c..3b6f714 100644 --- a/app/controllers/api.php +++ b/app/controllers/api.php @@ -27,4 +27,12 @@ $api->post('/entries', function (Request $request) use ($app) { return $app->json($entry, 201); }); +$api->get('/get', function (Request $request) use ($app) { + $id = $request->request->get('id'); + + $entry = $app['entry_api']->getEntryById($id); + + return $app->json($entry, 201); +}); + return $api;