diff options
author | Thedro Neely <thedroneely@gmail.com> | 2019-05-16 00:35:00 -0400 |
---|---|---|
committer | Thedro Neely <thedroneely@gmail.com> | 2019-05-16 00:35:00 -0400 |
commit | d1005d13cb7b303ebaccaa262c101463ce7b4f92 (patch) | |
tree | 205ecf303311790d6285bb311093f58115d1e733 | |
parent | bda06efb4488f76e3e5b87c8f36d08f338b35551 (diff) | |
download | thedroneely.com-d1005d13cb7b303ebaccaa262c101463ce7b4f92.tar.gz thedroneely.com-d1005d13cb7b303ebaccaa262c101463ce7b4f92.tar.bz2 thedroneely.com-d1005d13cb7b303ebaccaa262c101463ce7b4f92.zip |
app/controllers/api: Add simple api route to update thumbnails
-rw-r--r-- | app/Routes.php | 12 | ||||
-rw-r--r-- | app/controllers/api/thumbnails.controller.php | 8 |
2 files changed, 18 insertions, 2 deletions
diff --git a/app/Routes.php b/app/Routes.php index 35cdd3e..16abe96 100644 --- a/app/Routes.php +++ b/app/Routes.php @@ -1,6 +1,7 @@ <?php - -/* public routes */ +/** + * Public routes + */ $router->get('', '../app/controllers/index.controller.php'); @@ -19,3 +20,10 @@ $router->head('contact', '../app/controllers/contact.controller.php'); $router->post('upload', '../app/controllers/upload.controller.php'); $router->post('contact', '../app/controllers/contact.controller.php'); + + +/** + * Api routes + */ + +$router->post('api/thumbnails', '../app/controllers/api/thumbnails.controller.php'); diff --git a/app/controllers/api/thumbnails.controller.php b/app/controllers/api/thumbnails.controller.php new file mode 100644 index 0000000..5741a47 --- /dev/null +++ b/app/controllers/api/thumbnails.controller.php @@ -0,0 +1,8 @@ +<?php +/** + * Update Thumbnails + */ +if ($_SERVER['REQUEST_METHOD'] === 'POST') { + $updateTumbnails = shell_exec('../bootstrap/helpers/update-thumbnails'); + echo '<pre>' . $updateTumbnails . '</pre>'; +} |