summaryrefslogtreecommitdiff
path: root/html/app/routes/api.php
diff options
context:
space:
mode:
authorGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-04-17 12:12:22 +0300
committerGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-04-17 12:12:22 +0300
commit68fc9e55e538e03f94509731ab41a0c8cf96710f (patch)
tree3edb1e81864ac3eb35ba0fe8087ed24da1b812bf /html/app/routes/api.php
parent84b2da85a1b452922dadb6a609533b9945afe51d (diff)
downloadclassroom-68fc9e55e538e03f94509731ab41a0c8cf96710f.tar.gz
classroom-68fc9e55e538e03f94509731ab41a0c8cf96710f.tar.bz2
classroom-68fc9e55e538e03f94509731ab41a0c8cf96710f.zip
setup a real server environment (apache DocumentRoot=/var/www/public)
Diffstat (limited to 'html/app/routes/api.php')
-rw-r--r--html/app/routes/api.php81
1 files changed, 0 insertions, 81 deletions
diff --git a/html/app/routes/api.php b/html/app/routes/api.php
deleted file mode 100644
index 61e485b..0000000
--- a/html/app/routes/api.php
+++ /dev/null
@@ -1,81 +0,0 @@
-<?php
-
-use app\controllers\Auth;
-use app\controllers\api\Common_api;
-use app\controllers\api\Doc_api;
-
-
-/** API CALLS
- * -----------------------------------------------------------------------------
- *
- * these calls return json responses
- */
-
-
-// api: tree of product-categories
-Route::add('/api/tree',
- function() { Doc_api::tree(); },
- 'get'
-);
-
-// api: database documentation
-Route::add('/api/doc',
- function() { Doc_api::dbDoc(); },
- 'get'
-);
-
-Route::add('/api/url/([0-9a-zA-Z-_\/]*)',
- function($url) { Common_api::category_by_url($url); }
-);
-
-// route: /api/table
-Route::add('/api/([0-9a-zA-Z-_]*)',
- function($table) { Common_api::table($table); },
- 'get'
-);
-
-// route: /api/table/{id}
-Route::add('/api/([0-9a-zA-Z-_]*)/([0-9]*)',
- function($table, $id) { Common_api::record($table, $id); },
- 'get'
-);
-
-
-
-/** XML CALLS
- * -----------------------------------------------------------------------------
- *
- * These calls are like `/api`, except...
- * they return xml/html as part of the responses;
- *
- * example: { success: true, message: html }
- *
- * Used when an html message needs to be passed in some div
- *
- */
-
-
-
-
-/** TEST CALLS
- * -----------------------------------------------------------------------------
- *
- * direct calls to simple tests
- *
- */
-
-
-// route for testing...
-// ---
-Route::add('/test/([0-9a-zA-Z-_\/]*)', function($test) {
-
- // TODO:
- // hide tests from production
-
- if (file_exists(TESTS_DIRECTORY . $test .'.php')) {
- if (!Benchmark::exist('start')) Benchmark::add_spot('start');
- require(TESTS_DIRECTORY . $test .'.php');
- } else { echo "Test {$test} not exist";
- } die();
-
-});