From 4f2d900af7636e6744ae14aeeefdf2d6080ac50a Mon Sep 17 00:00:00 2001 From: George Halkiadakis Date: Thu, 30 Mar 2023 05:03:23 +0300 Subject: several mail options tested; mailhog (fake) mailer is working --- html/app/routes/api.php | 68 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 19 deletions(-) (limited to 'html/app/routes/api.php') diff --git a/html/app/routes/api.php b/html/app/routes/api.php index 659c25f..ecf15fb 100644 --- a/html/app/routes/api.php +++ b/html/app/routes/api.php @@ -1,8 +1,17 @@ runQuery("SELECT sku, -# max(ProductPrice_OriginalPrice) as MX, -# min(ProductPrice_OriginalPrice) as MN, -# ((max(ProductPrice_OriginalPrice)-min(ProductPrice_OriginalPrice))/max(ProductPrice_OriginalPrice)) as Di -# FROM prices -# GROUP BY sku -# ORDER BY Di desc -# LIMIT 300", -# [] -# ); -# reply_json([ -# 'success' => true, -# 'result' => $wtf -# ]); die(); -# }); + +/** 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 + * + */ + + +// user sends a registration form; +Route::add('/xml/register', function() { $x = Auth::register(); print_r($x); }, 'post'); + + +// user sends a confirmation request (alongside with some 'account' token) +Route::add('/xml/confirm-account', function() { Auth::confirm_account(); } ); + + +// user sends a reset password request) +Route::add('/xml/reset-password', function() { Auth::confirm(); } ); + + + + +/** 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(); + }); -- cgit v1.2.3