From 18e6796726d73d7dc90ecdd16c181493941f5487 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Thu, 15 Dec 2016 10:13:00 +0100 Subject: REST API structure using Slim framework * REST API routes are handle by Slim. * Every API controller go through ApiMiddleware which handles security. * First service implemented `/info`, for tests purpose. --- application/api/controllers/Info.php | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 application/api/controllers/Info.php (limited to 'application/api/controllers/Info.php') diff --git a/application/api/controllers/Info.php b/application/api/controllers/Info.php new file mode 100644 index 00000000..25433f72 --- /dev/null +++ b/application/api/controllers/Info.php @@ -0,0 +1,42 @@ + count($this->linkDb), + 'private_counter' => count_private($this->linkDb), + 'settings' => array( + 'title' => $this->conf->get('general.title', 'Shaarli'), + 'header_link' => $this->conf->get('general.header_link', '?'), + 'timezone' => $this->conf->get('general.timezone', 'UTC'), + 'enabled_plugins' => $this->conf->get('general.enabled_plugins', []), + 'default_private_links' => $this->conf->get('privacy.default_private_links', false), + ), + ]; + + return $response->withJson($info, 200, $this->jsonStyle); + } +} -- cgit v1.2.3