From 9aebaab3a198fcc5334119bdbef10750e08878ae Mon Sep 17 00:00:00 2001 From: Geo Halkiadakis Date: Mon, 8 May 2023 17:22:09 +0300 Subject: refactoring anom-parametres setup --- public/app/routes/api.php | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) (limited to 'public/app/routes/api.php') diff --git a/public/app/routes/api.php b/public/app/routes/api.php index 61e485b..80676ff 100644 --- a/public/app/routes/api.php +++ b/public/app/routes/api.php @@ -56,26 +56,19 @@ Route::add('/api/([0-9a-zA-Z-_]*)/([0-9]*)', - /** TEST CALLS * ----------------------------------------------------------------------------- * * direct calls to simple tests - * + * (not on production environment) */ - - -// 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(); - -}); +if (!PRODUCTION) { + Route::add('/test/([0-9a-zA-Z-_\/]*)', function($test) { + 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(); + + }); +} -- cgit v1.2.3