64 lines
1.7 KiB
PHP
64 lines
1.7 KiB
PHP
<?php
|
|
|
|
require __DIR__ . '/../vendor/autoload.php';
|
|
|
|
use App\Bootstrap\AppBootstrap;
|
|
use App\Config\AppConfig;
|
|
use App\Modules\Health\HealthRoutes;
|
|
use App\Modules\Auth\AuthRoutes;
|
|
use App\Modules\Retribusi\RetribusiRoutes;
|
|
use App\Modules\Retribusi\Summary\SummaryRoutes;
|
|
use App\Modules\Retribusi\Dashboard\DashboardRoutes;
|
|
use App\Modules\Retribusi\Realtime\RealtimeRoutes;
|
|
|
|
AppConfig::loadEnv(__DIR__ . '/..');
|
|
$app = AppBootstrap::create();
|
|
|
|
// Register routes
|
|
HealthRoutes::register($app);
|
|
AuthRoutes::register($app);
|
|
RetribusiRoutes::register($app);
|
|
SummaryRoutes::register($app);
|
|
DashboardRoutes::register($app);
|
|
RealtimeRoutes::register($app);
|
|
|
|
// Get all routes
|
|
$routes = [];
|
|
foreach ($app->getRouteCollector()->getRoutes() as $route) {
|
|
foreach ($route->getMethods() as $method) {
|
|
$routes[] = [
|
|
'method' => $method,
|
|
'pattern' => $route->getPattern()
|
|
];
|
|
}
|
|
}
|
|
|
|
echo "=== Registered Routes ===\n\n";
|
|
foreach ($routes as $route) {
|
|
echo "{$route['method']} {$route['pattern']}\n";
|
|
}
|
|
|
|
echo "\n=== Testing Specific Routes ===\n";
|
|
$testRoutes = [
|
|
'/health',
|
|
'/auth/v1/login',
|
|
'/retribusi/v1/frontend/locations',
|
|
'/retribusi/v1/dashboard/summary',
|
|
'/retribusi/v1/dashboard/daily',
|
|
'/retribusi/v1/realtime/snapshot',
|
|
];
|
|
|
|
foreach ($testRoutes as $testRoute) {
|
|
$found = false;
|
|
foreach ($routes as $route) {
|
|
// Simple pattern matching
|
|
$pattern = str_replace(['{', '}'], ['', ''], $route['pattern']);
|
|
if (strpos($testRoute, $pattern) === 0 || $route['pattern'] === $testRoute) {
|
|
$found = true;
|
|
break;
|
|
}
|
|
}
|
|
echo ($found ? '✅' : '❌') . " {$testRoute}\n";
|
|
}
|
|
|