<?php

use CodeIgniter\Router\RouteCollection;

/** @var RouteCollection $routes */
$routes->setDefaultNamespace('App\Controllers');
$routes->setDefaultController('PazarController');
$routes->setDefaultMethod('dispatch');
$routes->setTranslateURIDashes(false);
$routes->set404Override(static function () {
    return service('response')->setStatusCode(404)->setBody('404 - Halaman tidak ditemukan');
});
$routes->setAutoRoute(false);

$routes->match(['get', 'post'], '/', 'PazarController::dispatch');
$routes->match(['get', 'post'], '(:any)', 'PazarController::dispatch/$1');
