diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/Routes.php | 4 | ||||
-rw-r--r-- | app/controllers/api/cache.controller.php | 7 | ||||
-rw-r--r-- | app/controllers/api/thumbnails.controller.php | 3 |
3 files changed, 10 insertions, 4 deletions
diff --git a/app/Routes.php b/app/Routes.php index 05edf2f..3088e75 100644 --- a/app/Routes.php +++ b/app/Routes.php @@ -2,7 +2,6 @@ /** * Public routes */ - $router->get('', '../app/controllers/index.controller.php'); $router->get('contact', '../app/controllers/contact.controller.php'); @@ -25,5 +24,6 @@ $router->post('contact', '../app/controllers/contact.controller.php'); /** * Api routes */ - $router->post('api/v1/thumbnails', '../app/controllers/api/thumbnails.controller.php'); + +$router->post('api/v1/cache', '../app/controllers/api/cache.controller.php'); diff --git a/app/controllers/api/cache.controller.php b/app/controllers/api/cache.controller.php new file mode 100644 index 0000000..2286445 --- /dev/null +++ b/app/controllers/api/cache.controller.php @@ -0,0 +1,7 @@ +<?php +/** + * Invalidate cache + */ +if ($_SERVER['REQUEST_METHOD'] === 'POST') { + echo $cacheBust = shell_exec('../bootstrap/helpers/cache-bust'); +} diff --git a/app/controllers/api/thumbnails.controller.php b/app/controllers/api/thumbnails.controller.php index 5741a47..f2657c0 100644 --- a/app/controllers/api/thumbnails.controller.php +++ b/app/controllers/api/thumbnails.controller.php @@ -3,6 +3,5 @@ * Update Thumbnails */ if ($_SERVER['REQUEST_METHOD'] === 'POST') { - $updateTumbnails = shell_exec('../bootstrap/helpers/update-thumbnails'); - echo '<pre>' . $updateTumbnails . '</pre>'; + echo $updateTumbnails = shell_exec('../bootstrap/helpers/update-thumbnails'); } |