diff --git a/www-api/app/Config/Routes.php b/www-api/app/Config/Routes.php index 87544cde..2ce2266f 100644 --- a/www-api/app/Config/Routes.php +++ b/www-api/app/Config/Routes.php @@ -167,7 +167,7 @@ $routes->get('/en/wrench/api/v1/blogdata/', 'WrenchBlog::website'); $routes->get('/en/wrench/api/v1/blogdata/(:any)', 'WrenchBlog::blogLimitedData/$1'); $routes->post('/en/wrench/api/v1/blogdata/', 'WrenchBlog::website'); -$routes->post('/en/wrench/api/v1/blogdata/(:any)', 'WrenchBlog::blogLimitedData/$1'); +//$routes->post('/en/wrench/api/v1/blogdata/(:any)', 'WrenchBlog::blogLimitedData/$1'); diff --git a/www-api/app/Controllers/WrenchBlog.php b/www-api/app/Controllers/WrenchBlog.php index 177bfa31..c84bdabb 100644 --- a/www-api/app/Controllers/WrenchBlog.php +++ b/www-api/app/Controllers/WrenchBlog.php @@ -66,7 +66,16 @@ class WrenchBlog extends BaseController } public function website(){ + + $endpoint = "WRENCH_BLOG_DATA"; + $res1 = $this->getCache($endpoint); + if (count($res1)==0){ + $rawData = $this->apiData(); + $res1= $rawData['payload']; //[0]['payload']; + $this->saveCache($endpoint,$res1); + } + return $this->response->setJson($res1); } public function blogLimitedData($inData){