From 2b4770301cbcaed3838ae3c0b175a985d1b4fb4f Mon Sep 17 00:00:00 2001 From: Vincent Date: Mon, 7 Mar 2016 15:00:03 +0100 Subject: Add version in API --- .../ApiBundle/Controller/WallabagRestController.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index 35a90edd..5f342825 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php @@ -340,6 +340,19 @@ class WallabagRestController extends FOSRestController return $this->renderJsonResponse($json); } + /** + * Retrive version. + * + * @return Response + */ + public function getVersionAction() + { + $version = $this->container->getParameter('wallabag_core.version'); + + $json = $this->get('serializer')->serialize($version, 'json'); + + return $this->renderJsonResponse($json); + } /** * Validate that the first id is equal to the second one. -- cgit v1.2.3