<?php

use CodeIgniter\Router\RouteCollection;

/**
 * @var RouteCollection $routes
 */
$routes->get('/', 'Home::index');
$routes->get('/api', 'ApiController::index');
$routes->get('/api/catalogue', 'ApiController::catalogue');
$routes->get('/switch-page', 'SwitchController::index');

$routes->get('/api/switch/status', 'SwitchController::status');   
$routes->get('/api/switch/complete', 'SwitchController::complete');
$routes->get('/api/switch/(:segment)', 'SwitchController::toggle/$1');
$routes->get('/abort', 'SwitchController::abort');
$routes->get('payment/create-order', 'PaymentController::createOrder');
$routes->post('payment/verify', 'PaymentController::verifyPayment');

// Handle CORS Preflight OPTIONS requests for all routes
$routes->options('(:any)', static function () {});
